bpo-45532: Replace 'default' with 'main' as default in sys.version (GH-29100)

This commit is contained in:
Jeong YunWon 2021-10-21 02:09:03 +09:00 committed by GitHub
parent dff0b71343
commit d2cd5eef0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1,2 @@
Update :data:`sys.version` to use ``main`` as fallback information.
Patch by Jeong YunWon.

View File

@ -40,8 +40,9 @@ Py_GetBuildInfo(void)
const char *revision = _Py_gitversion(); const char *revision = _Py_gitversion();
const char *sep = *revision ? ":" : ""; const char *sep = *revision ? ":" : "";
const char *gitid = _Py_gitidentifier(); const char *gitid = _Py_gitidentifier();
if (!(*gitid)) if (!(*gitid)) {
gitid = "default"; gitid = "main";
}
PyOS_snprintf(buildinfo, sizeof(buildinfo), PyOS_snprintf(buildinfo, sizeof(buildinfo),
"%s%s%s, %.20s, %.9s", gitid, sep, revision, "%s%s%s, %.20s, %.9s", gitid, sep, revision,
DATE, TIME); DATE, TIME);