From 5d72c723dc1961836a4037aaefc83f10c50ab5d1 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Wed, 21 Dec 2022 14:03:41 +1100 Subject: [PATCH] gh-100388: Change undefined __DATE__ to valid date --- .../2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst | 2 ++ Modules/getbuildinfo.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst b/Misc/NEWS.d/next/Core_and_Builtins/2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst new file mode 100644 index 00000000000000..d859c5511e6dc1 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst @@ -0,0 +1,2 @@ +Fix the ``platform._sys_version()`` method when ``__DATE__`` is undefined at +buildtime by changing default buildtime datetime string to the UNIX epoch. diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 8d553d106c6ab5..b68f0f5cc56a44 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -13,7 +13,7 @@ #ifdef __DATE__ #define DATE __DATE__ #else -#define DATE "xx/xx/xx" +#define DATE "Jan 01 1970" #endif #endif @@ -21,7 +21,7 @@ #ifdef __TIME__ #define TIME __TIME__ #else -#define TIME "xx:xx:xx" +#define TIME "00:00:00" #endif #endif