mirror of
https://github.com/python/cpython.git
synced 2025-10-04 14:15:45 +00:00
* 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. (cherry picked from commit5c4b0d063a
) (cherry picked from commit95c50e5aed
)
This commit is contained in:
parent
2df52acce2
commit
a2edd3ae40
9 changed files with 80 additions and 83 deletions
|
@ -1199,7 +1199,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue