summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-10-20 10:45:06 -0700
committerGitHub <noreply@github.com>2021-10-20 10:45:06 -0700
commit1249ce7c6c0ac7a99a72e6e7b8b10dd64158c386 (patch)
tree35ba68c1cb0c6942162adbee6d0f505d3e77432f
parent919268316582c6ac47960c2e5dd2ee1682371494 (diff)
downloadcpython-git-1249ce7c6c0ac7a99a72e6e7b8b10dd64158c386.tar.gz
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>
-rw-r--r--Misc/NEWS.d/next/Build/2021-10-20-16-07-39.bpo-45532.kyhvis.rst2
-rw-r--r--Modules/getbuildinfo.c5
2 files changed, 5 insertions, 2 deletions
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 0000000000..575e2fb9ae
--- /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 5f941a26e1..7cb7397a22 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);