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
9001cde5
Kaydet (Commit)
9001cde5
authored
Mar 25, 2004
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix last patch to be backwards-compatible with Python 1.5.2 .
Bumped version micro number.
üst
21beb4c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
platform.py
Lib/platform.py
+25
-12
No files found.
Lib/platform.py
Dosyayı görüntüle @
9001cde5
...
...
@@ -31,6 +31,7 @@
# Colin Kong, Trent Mick
#
# History:
# 1.0.2 - fix a bug with caching of value for platform()
# 1.0.1 - reformatted to make doc.py happy
# 1.0.0 - reformatted a bit and checked into Python CVS
# 0.8.0 - added sys.version parser and various new access
...
...
@@ -102,7 +103,7 @@ __copyright__ = """
"""
__version__
=
'1.0.
1
'
__version__
=
'1.0.
2
'
import
sys
,
string
,
os
,
re
...
...
@@ -1135,8 +1136,10 @@ def python_compiler():
### The Opus Magnum of platform strings :-)
_platform_cache
=
{
True
:
None
,
False
:
None
}
_platform_aliased_cache
=
{
True
:
None
,
False
:
None
}
_platform_cache_terse
=
None
_platform_cache_not_terse
=
None
_platform_aliased_cache_terse
=
None
_platform_aliased_cache_not_terse
=
None
def
platform
(
aliased
=
0
,
terse
=
0
):
...
...
@@ -1157,12 +1160,17 @@ def platform(aliased=0, terse=0):
absolute minimum information needed to identify the platform.
"""
global
_platform_cache
,
_platform_aliased_cache
if
not
aliased
and
(
_platform_cache
[
bool
(
terse
)]
is
not
None
):
return
_platform_cache
[
bool
(
terse
)]
elif
_platform_aliased_cache
[
bool
(
terse
)]
is
not
None
:
return
_platform_aliased_cache
[
bool
(
terse
)]
global
_platform_cache_terse
,
_platform_cache_not_terse
global
_platform_aliased_cache_terse
,
_platform_aliased_cache_not_terse
if
not
aliased
and
terse
and
(
_platform_cache_terse
is
not
None
):
return
_platform_cache_terse
elif
not
aliased
and
not
terse
and
(
_platform_cache_not_terse
is
not
None
):
return
_platform_cache_not_terse
elif
terse
and
_platform_aliased_cache_terse
is
not
None
:
return
_platform_aliased_cache_terse
elif
not
terse
and
_platform_aliased_cache_not_terse
is
not
None
:
return
_platform_aliased_cache_not_terse
# Get uname information and then apply platform specific cosmetics
# to it...
...
...
@@ -1218,12 +1226,17 @@ def platform(aliased=0, terse=0):
bits
,
linkage
=
architecture
(
sys
.
executable
)
platform
=
_platform
(
system
,
release
,
machine
,
processor
,
bits
,
linkage
)
if
aliased
:
_platform_aliased_cache
[
bool
(
terse
)]
=
platform
if
aliased
and
terse
:
_platform_aliased_cache_terse
=
platform
elif
aliased
and
not
terse
:
_platform_aliased_cache_not_terse
=
platform
elif
terse
:
pass
else
:
_platform_cache
[
bool
(
terse
)]
=
platform
if
terse
:
_platform_cache_terse
=
platform
else
:
_platform_cache_not_terse
=
platform
return
platform
### Command line interface
...
...
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