Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f076f533
Kaydet (Commit)
f076f533
authored
Eki 21, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#8964: fix platform._sys_version to handle IronPython 2.6+.
üst
c3184425
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
3 deletions
+33
-3
platform.py
Lib/platform.py
+16
-3
test_platform.py
Lib/test/test_platform.py
+13
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/platform.py
Dosyayı görüntüle @
f076f533
...
@@ -1248,6 +1248,14 @@ _ironpython_sys_version_parser = re.compile(
...
@@ -1248,6 +1248,14 @@ _ironpython_sys_version_parser = re.compile(
'(?:
\
(([
\
d
\
.]+)
\
))?'
'(?:
\
(([
\
d
\
.]+)
\
))?'
' on (.NET [
\
d
\
.]+)'
,
re
.
ASCII
)
' on (.NET [
\
d
\
.]+)'
,
re
.
ASCII
)
# IronPython covering 2.6 and 2.7
_ironpython26_sys_version_parser
=
re
.
compile
(
r'([\d.]+)\s*'
'
\
(IronPython
\
s*'
'[
\
d.]+
\
s*'
'
\
(([
\
d.]+)
\
) on ([
\
w.]+ [
\
d.]+(?:
\
(
\
d+-bit
\
))?)
\
)'
)
_pypy_sys_version_parser
=
re
.
compile
(
_pypy_sys_version_parser
=
re
.
compile
(
r'([\w.+]+)\s*'
r'([\w.+]+)\s*'
'
\
(#?([^,]+),
\
s*([
\
w ]+),
\
s*([
\
w :]+)
\
)
\
s*'
'
\
(#?([^,]+),
\
s*([
\
w ]+),
\
s*([
\
w :]+)
\
)
\
s*'
...
@@ -1285,19 +1293,24 @@ def _sys_version(sys_version=None):
...
@@ -1285,19 +1293,24 @@ def _sys_version(sys_version=None):
return
result
return
result
# Parse it
# Parse it
if
sys_version
[:
10
]
==
'IronPython'
:
if
'IronPython'
in
sys_version
:
# IronPython
# IronPython
name
=
'IronPython'
name
=
'IronPython'
match
=
_ironpython_sys_version_parser
.
match
(
sys_version
)
if
sys_version
.
startswith
(
'IronPython'
):
match
=
_ironpython_sys_version_parser
.
match
(
sys_version
)
else
:
match
=
_ironpython26_sys_version_parser
.
match
(
sys_version
)
if
match
is
None
:
if
match
is
None
:
raise
ValueError
(
raise
ValueError
(
'failed to parse IronPython sys.version:
%
s'
%
'failed to parse IronPython sys.version:
%
s'
%
repr
(
sys_version
))
repr
(
sys_version
))
version
,
alt_version
,
compiler
=
match
.
groups
()
version
,
alt_version
,
compiler
=
match
.
groups
()
buildno
=
''
buildno
=
''
builddate
=
''
builddate
=
''
elif
sys
.
platform
[:
4
]
==
'java'
:
elif
sys
.
platform
.
startswith
(
'java'
)
:
# Jython
# Jython
name
=
'Jython'
name
=
'Jython'
match
=
_sys_version_parser
.
match
(
sys_version
)
match
=
_sys_version_parser
.
match
(
sys_version
)
...
...
Lib/test/test_platform.py
Dosyayı görüntüle @
f076f533
...
@@ -91,15 +91,28 @@ class PlatformTest(unittest.TestCase):
...
@@ -91,15 +91,28 @@ class PlatformTest(unittest.TestCase):
(
"CPython"
,
"2.6.1"
,
"tags/r261"
,
"67515"
,
(
"CPython"
,
"2.6.1"
,
"tags/r261"
,
"67515"
,
(
'r261:67515'
,
'Dec 6 2008 15:26:00'
),
(
'r261:67515'
,
'Dec 6 2008 15:26:00'
),
'GCC 4.0.1 (Apple Computer, Inc. build 5370)'
),
'GCC 4.0.1 (Apple Computer, Inc. build 5370)'
),
(
"IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053"
,
None
,
"cli"
)
(
"IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053"
,
None
,
"cli"
)
:
:
(
"IronPython"
,
"2.0.0"
,
""
,
""
,
(
""
,
""
),
(
"IronPython"
,
"2.0.0"
,
""
,
""
,
(
""
,
""
),
".NET 2.0.50727.3053"
),
".NET 2.0.50727.3053"
),
(
"2.6.1 (IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433)"
,
None
,
"cli"
)
:
(
"IronPython"
,
"2.6.1"
,
""
,
""
,
(
""
,
""
),
".NET 2.0.50727.1433"
),
(
"2.7.4 (IronPython 2.7.4 (2.7.0.40) on Mono 4.0.30319.1 (32-bit))"
,
None
,
"cli"
)
:
(
"IronPython"
,
"2.7.4"
,
""
,
""
,
(
""
,
""
),
"Mono 4.0.30319.1 (32-bit)"
),
(
"2.5 (trunk:6107, Mar 26 2009, 13:02:18)
\n
[Java HotSpot(TM) Client VM (
\"
Apple Computer, Inc.
\"
)]"
,
(
"2.5 (trunk:6107, Mar 26 2009, 13:02:18)
\n
[Java HotSpot(TM) Client VM (
\"
Apple Computer, Inc.
\"
)]"
,
(
'Jython'
,
'trunk'
,
'6107'
),
"java1.5.0_16"
)
(
'Jython'
,
'trunk'
,
'6107'
),
"java1.5.0_16"
)
:
:
(
"Jython"
,
"2.5.0"
,
"trunk"
,
"6107"
,
(
"Jython"
,
"2.5.0"
,
"trunk"
,
"6107"
,
(
'trunk:6107'
,
'Mar 26 2009'
),
"java1.5.0_16"
),
(
'trunk:6107'
,
'Mar 26 2009'
),
"java1.5.0_16"
),
(
"2.5.2 (63378, Mar 26 2009, 18:03:29)
\n
[PyPy 1.0.0]"
,
(
"2.5.2 (63378, Mar 26 2009, 18:03:29)
\n
[PyPy 1.0.0]"
,
(
'PyPy'
,
'trunk'
,
'63378'
),
self
.
save_platform
)
(
'PyPy'
,
'trunk'
,
'63378'
),
self
.
save_platform
)
:
:
...
...
Misc/ACKS
Dosyayı görüntüle @
f076f533
...
@@ -791,6 +791,7 @@ Nick Mathewson
...
@@ -791,6 +791,7 @@ Nick Mathewson
Simon Mathieu
Simon Mathieu
Laura Matson
Laura Matson
Graham Matthews
Graham Matthews
Martin Matusiak
Dieter Maurer
Dieter Maurer
Daniel May
Daniel May
Madison May
Madison May
...
...
Misc/NEWS
Dosyayı görüntüle @
f076f533
...
@@ -78,6 +78,9 @@ Core and Builtins
...
@@ -78,6 +78,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #8964: fix platform._sys_version to handle IronPython 2.6+.
Patch by Martin Matusiak.
- Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read by
- Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read by
limiting the call to readline(). Original patch by Michał
limiting the call to readline(). Original patch by Michał
Jastrzębski and Giampaolo Rodola.
Jastrzębski and Giampaolo Rodola.
...
...
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