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
b457b893
Commit
b457b893
authored
Mar 26, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more and more implementations now support sys.subversion
parent
f521b8c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
16 deletions
+11
-16
Lib/platform.py
Lib/platform.py
+8
-13
Lib/test/test_platform.py
Lib/test/test_platform.py
+3
-3
No files found.
Lib/platform.py
View file @
b457b893
...
...
@@ -1311,8 +1311,6 @@ def _sys_version(sys_version=None):
'
failed
to
parse
IronPython
sys
.
version
:
%
s
' %
repr(sys_version))
version, alt_version, compiler = match.groups()
branch = ''
revision = ''
buildno = ''
builddate = ''
...
...
@@ -1325,11 +1323,7 @@ def _sys_version(sys_version=None):
'
failed
to
parse
Jython
sys
.
version
:
%
s
' %
repr(sys_version))
version, buildno, builddate, buildtime, _ = match.groups()
branch = ''
revision = ''
compiler = sys.platform
buildno = ''
builddate = ''
else:
# CPython
...
...
@@ -1340,15 +1334,16 @@ def _sys_version(sys_version=None):
repr(sys_version))
version, buildno, builddate, buildtime, compiler =
\
match.groups()
if hasattr(sys, '
subversion
'):
# sys.subversion was added in Python 2.5
name, branch, revision = sys.subversion
else:
name = '
CPython
'
branch = ''
revision = ''
name = '
CPython
'
builddate = builddate + '
' + buildtime
if hasattr(sys, '
subversion
'):
# sys.subversion was added in Python 2.5
_, branch, revision = sys.subversion
else:
branch = ''
revision = ''
# Add the patchlevel version if missing
l = string.split(version, '
.
')
if len(l) == 2:
...
...
Lib/test/test_platform.py
View file @
b457b893
...
...
@@ -73,10 +73,10 @@ class PlatformTest(unittest.TestCase):
(
"IronPython"
,
"2.0.0"
,
""
,
""
,
(
""
,
""
),
".NET 2.0.50727.3053"
),
(
"2.5 (trunk:6107, Mar 26 2009, 13:02:18)
\
n
[Java HotSpot(TM) Client VM (
\
"
Apple Computer, Inc.
\
"
)]"
,
None
,
"java1.5.0_16"
)
(
'Jython'
,
'trunk'
,
'6107'
)
,
"java1.5.0_16"
)
:
(
"Jython"
,
"2.5.0"
,
"
"
,
""
,
(
""
,
""
)
,
"java1.5.0_16"
),
(
"Jython"
,
"2.5.0"
,
"
trunk"
,
"6107"
,
(
'trunk:6107'
,
'Mar 26 2009'
),
"java1.5.0_16"
),
}
for
(
version_tag
,
subversion
,
sys_platform
),
info
in
\
sys_versions
.
iteritems
():
...
...
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