diff options
author | Ned Deily <nad@python.org> | 2017-03-04 05:19:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-04 05:19:55 (GMT) |
commit | 5c4b0d063aba0a68c325073f5f312a2c9f40d178 (patch) | |
tree | 9dd85d1261b732477a4ed38bd5d63de2d3c2e847 /Lib/platform.py | |
parent | fc64c351c7757f0ebdb7da65cb74871e494a2add (diff) | |
download | cpython-5c4b0d063aba0a68c325073f5f312a2c9f40d178.zip cpython-5c4b0d063aba0a68c325073f5f312a2c9f40d178.tar.gz cpython-5c4b0d063aba0a68c325073f5f312a2c9f40d178.tar.bz2 |
bpo-27593: Get SCM build info from git instead of hg. (#446)
sys.version and the platform module python_build(),
python_branch(), and python_revision() functions now use
git information rather than hg when building from a repo.
Based on original patches by Brett Cannon and Steve Dower.
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 0623475..cc2db98 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -1198,7 +1198,9 @@ def _sys_version(sys_version=None): elif buildtime: builddate = builddate + ' ' + buildtime - if hasattr(sys, '_mercurial'): + if hasattr(sys, '_git'): + _, branch, revision = sys._git + elif hasattr(sys, '_mercurial'): _, branch, revision = sys._mercurial elif hasattr(sys, 'subversion'): # sys.subversion was added in Python 2.5 |