diff --git a/Makefile.pre.in b/Makefile.pre.in index a4d99262702a17..49a13f7b14053b 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1786,6 +1786,7 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h $(CC) -c $(PY_CORE_CFLAGS) \ -DABIFLAGS='"$(ABIFLAGS)"' \ + -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \ $(MULTIARCH_CPPFLAGS) \ -o $@ $(srcdir)/Python/sysmodule.c diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 887a916563a2e1..05f2a5eae1acea 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -3250,6 +3250,7 @@ static PyStructSequence_Field version_info_fields[] = { {"micro", "Patch release number"}, {"releaselevel", "'alpha', 'beta', 'candidate', or 'final'"}, {"serial", "Serial release number"}, + {"devel", "Development build"}, {0} }; @@ -3257,7 +3258,7 @@ static PyStructSequence_Desc version_info_desc = { "sys.version_info", /* name */ version_info__doc__, /* doc */ version_info_fields, /* fields */ - 5 + 5 /* n_in_sequence */ }; static PyObject * @@ -3290,12 +3291,15 @@ make_version_info(PyThreadState *tstate) PyStructSequence_SET_ITEM(version_info, pos++, PyLong_FromLong(flag)) #define SetStrItem(flag) \ PyStructSequence_SET_ITEM(version_info, pos++, PyUnicode_FromString(flag)) +#define SetBoolItem(flag) \ + PyStructSequence_SET_ITEM(version_info, pos++, PyBool_FromLong(flag)) SetIntItem(PY_MAJOR_VERSION); SetIntItem(PY_MINOR_VERSION); SetIntItem(PY_MICRO_VERSION); SetStrItem(s); SetIntItem(PY_RELEASE_SERIAL); + SetBoolItem(strncmp(GITTAG, "tags/", 5)); #undef SetIntItem #undef SetStrItem