Ned Deily <[email protected]> added the comment:
Victor is correct. Those GIT* variable are there to communicate between
./configure and the Makefile; they are *not* intended to have actual values for
change ids or branch names. Many variables in the Makefile are not intended to
be used outside of the build except for those that are explicitly documented or
are well-known autoconf variables, like CFLAGS.
While any Git VCS info for the build is captured in sys._git, the _ prefix
indicates it is a Python private attribute and thus is not documented. The
documented way to get any VCS info is via the platform module:
$ /usr/local/bin/python3.7
Python 3.7.1rc2 (v3.7.1rc2:6c06ef7dc3, Oct 13 2018, 05:10:29)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.python_branch()
'v3.7.1rc2'
>>> platform.python_revision()
'6c06ef7dc3'
>>> platform.python_build()
('v3.7.1rc2:6c06ef7dc3', 'Oct 13 2018 05:10:29')
https://docs.python.org/3/library/platform.html#platform.python_revision
----------
nosy: +ned.deily
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34994>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com