Skip to content

Commit dd95b0e

Browse files
committed
gh-119132: Update buildinfo to identify free-threaded or not.
1 parent 31a28cb commit dd95b0e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add build information to identify whether the build is default build or
2+
free-threading build. Patch By Donghee Na.

Modules/getbuildinfo.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ Py_GetBuildInfo(void)
5151
const char *revision = _Py_gitversion();
5252
const char *sep = *revision ? ":" : "";
5353
const char *gitid = _Py_gitidentifier();
54+
#ifdef Py_GIL_DISABLED
55+
const char *build = "free-threading";
56+
#else
57+
const char *build = "default";
58+
#endif
5459
if (!(*gitid)) {
5560
gitid = "main";
5661
}
5762
PyOS_snprintf(buildinfo, sizeof(buildinfo),
58-
"%s%s%s, %.20s, %.9s", gitid, sep, revision,
59-
DATE, TIME);
63+
"%s%s%s, %.20s, %.9s, %s", gitid, sep, revision,
64+
DATE, TIME, build);
6065
return buildinfo;
6166
}
6267

0 commit comments

Comments
 (0)