From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:45:06 +0000 (-0700) Subject: bpo-45532: Replace 'default' with 'main' as default in sys.version (GH-29100) X-Git-Tag: v3.9.8~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1249ce7c6c0ac7a99a72e6e7b8b10dd64158c386;p=thirdparty%2FPython%2Fcpython.git bpo-45532: Replace 'default' with 'main' as default in sys.version (GH-29100) (cherry picked from commit d2cd5eef0c3fc0431bfe3fc24b4c020ebfcf8aad) Co-authored-by: Jeong YunWon <69878+youknowone@users.noreply.github.com> --- diff --git a/Misc/NEWS.d/next/Build/2021-10-20-16-07-39.bpo-45532.kyhvis.rst b/Misc/NEWS.d/next/Build/2021-10-20-16-07-39.bpo-45532.kyhvis.rst new file mode 100644 index 000000000000..575e2fb9ae93 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-10-20-16-07-39.bpo-45532.kyhvis.rst @@ -0,0 +1,2 @@ +Update :data:`sys.version` to use ``main`` as fallback information. +Patch by Jeong YunWon. diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 5f941a26e1d5..7cb7397a22c8 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -40,8 +40,9 @@ Py_GetBuildInfo(void) const char *revision = _Py_gitversion(); const char *sep = *revision ? ":" : ""; const char *gitid = _Py_gitidentifier(); - if (!(*gitid)) - gitid = "default"; + if (!(*gitid)) { + gitid = "main"; + } PyOS_snprintf(buildinfo, sizeof(buildinfo), "%s%s%s, %.20s, %.9s", gitid, sep, revision, DATE, TIME);