Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8256242b
Commit
8256242b
authored
Mar 05, 2011
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt platform and test_platform to the build identification changes.
parent
1ca2e796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
Lib/platform.py
Lib/platform.py
+3
-1
Lib/test/test_platform.py
Lib/test/test_platform.py
+5
-1
No files found.
Lib/platform.py
View file @
8256242b
...
...
@@ -1373,7 +1373,9 @@ def _sys_version(sys_version=None):
name = '
CPython
'
builddate = builddate + '
' + buildtime
if hasattr(sys, '
subversion
'):
if hasattr(sys, '
_mercurial
'):
_, branch, revision = sys._mercurial
elif hasattr(sys, '
subversion
'):
# sys.subversion was added in Python 2.5
_, branch, revision = sys.subversion
else:
...
...
Lib/test/test_platform.py
View file @
8256242b
...
...
@@ -51,11 +51,13 @@ class PlatformTest(unittest.TestCase):
def
setUp
(
self
):
self
.
save_version
=
sys
.
version
self
.
save_subversion
=
sys
.
subversion
self
.
save_mercurial
=
sys
.
_mercurial
self
.
save_platform
=
sys
.
platform
def
tearDown
(
self
):
sys
.
version
=
self
.
save_version
sys
.
subversion
=
self
.
save_subversion
sys
.
_mercurial
=
self
.
save_mercurial
sys
.
platform
=
self
.
save_platform
def
test_sys_version
(
self
):
...
...
@@ -103,10 +105,12 @@ class PlatformTest(unittest.TestCase):
sys_versions
.
items
():
sys
.
version
=
version_tag
if
subversion
is
None
:
if
hasattr
(
sys
,
"_mercurial"
):
del
sys
.
_mercurial
if
hasattr
(
sys
,
"subversion"
):
del
sys
.
subversion
else
:
sys
.
subversion
=
subversion
sys
.
_mercurial
=
subversion
if
sys_platform
is
not
None
:
sys
.
platform
=
sys_platform
self
.
assertEqual
(
platform
.
python_implementation
(),
info
[
0
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment