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
559b5f1c
Kaydet (Commit)
559b5f1c
authored
May 25, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor cleanup in sysconfig.
Also remove outdated and unhelpful docstrings in test_sysconfig.
üst
9bcfacd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
18 deletions
+2
-18
sysconfig.py
Lib/sysconfig.py
+2
-3
test_sysconfig.py
Lib/test/test_sysconfig.py
+0
-15
No files found.
Lib/sysconfig.py
Dosyayı görüntüle @
559b5f1c
...
@@ -656,11 +656,10 @@ def get_platform():
...
@@ -656,11 +656,10 @@ def get_platform():
# to. This makes the compatibility story a bit more sane because the
# to. This makes the compatibility story a bit more sane because the
# machine is going to compile and link as if it were
# machine is going to compile and link as if it were
# MACOSX_DEPLOYMENT_TARGET.
# MACOSX_DEPLOYMENT_TARGET.
#
cfgvars
=
get_config_vars
()
cfgvars
=
get_config_vars
()
macver
=
cfgvars
.
get
(
'MACOSX_DEPLOYMENT_TARGET'
)
macver
=
cfgvars
.
get
(
'MACOSX_DEPLOYMENT_TARGET'
)
if
1
:
if
True
:
# Always calculate the release of the running machine,
# Always calculate the release of the running machine,
# needed to determine if we can build fat binaries or not.
# needed to determine if we can build fat binaries or not.
...
@@ -755,7 +754,7 @@ def _main():
...
@@ -755,7 +754,7 @@ def _main():
print
(
'Platform: "
%
s"'
%
get_platform
())
print
(
'Platform: "
%
s"'
%
get_platform
())
print
(
'Python version: "
%
s"'
%
get_python_version
())
print
(
'Python version: "
%
s"'
%
get_python_version
())
print
(
'Current installation scheme: "
%
s"'
%
_get_default_scheme
())
print
(
'Current installation scheme: "
%
s"'
%
_get_default_scheme
())
print
(
''
)
print
()
_print_dict
(
'Paths'
,
get_paths
())
_print_dict
(
'Paths'
,
get_paths
())
print
()
print
()
_print_dict
(
'Variables'
,
get_config_vars
())
_print_dict
(
'Variables'
,
get_config_vars
())
...
...
Lib/test/test_sysconfig.py
Dosyayı görüntüle @
559b5f1c
"""Tests for 'site'.
Tests assume the initial paths in sys.path once the interpreter has begun
executing have not been removed.
"""
import
unittest
import
unittest
import
sys
import
sys
import
os
import
os
...
@@ -23,7 +17,6 @@ from sysconfig import (get_paths, get_platform, get_config_vars,
...
@@ -23,7 +17,6 @@ from sysconfig import (get_paths, get_platform, get_config_vars,
class
TestSysConfig
(
unittest
.
TestCase
):
class
TestSysConfig
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
"""Make a copy of sys.path"""
super
(
TestSysConfig
,
self
)
.
setUp
()
super
(
TestSysConfig
,
self
)
.
setUp
()
self
.
sys_path
=
sys
.
path
[:]
self
.
sys_path
=
sys
.
path
[:]
self
.
makefile
=
None
self
.
makefile
=
None
...
@@ -53,7 +46,6 @@ class TestSysConfig(unittest.TestCase):
...
@@ -53,7 +46,6 @@ class TestSysConfig(unittest.TestCase):
self
.
_added_envvars
.
append
(
var
)
self
.
_added_envvars
.
append
(
var
)
def
tearDown
(
self
):
def
tearDown
(
self
):
"""Restore sys.path"""
sys
.
path
[:]
=
self
.
sys_path
sys
.
path
[:]
=
self
.
sys_path
if
self
.
makefile
is
not
None
:
if
self
.
makefile
is
not
None
:
os
.
unlink
(
self
.
makefile
)
os
.
unlink
(
self
.
makefile
)
...
@@ -145,8 +137,6 @@ class TestSysConfig(unittest.TestCase):
...
@@ -145,8 +137,6 @@ class TestSysConfig(unittest.TestCase):
(
'Darwin Kernel Version 8.11.1: '
(
'Darwin Kernel Version 8.11.1: '
'Wed Oct 10 18:23:28 PDT 2007; '
'Wed Oct 10 18:23:28 PDT 2007; '
'root:xnu-792.25.20~1/RELEASE_I386'
),
'PowerPC'
))
'root:xnu-792.25.20~1/RELEASE_I386'
),
'PowerPC'
))
get_config_vars
()[
'MACOSX_DEPLOYMENT_TARGET'
]
=
'10.3'
get_config_vars
()[
'MACOSX_DEPLOYMENT_TARGET'
]
=
'10.3'
get_config_vars
()[
'CFLAGS'
]
=
(
'-fno-strict-aliasing -DNDEBUG -g '
get_config_vars
()[
'CFLAGS'
]
=
(
'-fno-strict-aliasing -DNDEBUG -g '
...
@@ -161,7 +151,6 @@ class TestSysConfig(unittest.TestCase):
...
@@ -161,7 +151,6 @@ class TestSysConfig(unittest.TestCase):
finally
:
finally
:
sys
.
maxsize
=
maxint
sys
.
maxsize
=
maxint
self
.
_set_uname
((
'Darwin'
,
'macziade'
,
'8.11.1'
,
self
.
_set_uname
((
'Darwin'
,
'macziade'
,
'8.11.1'
,
(
'Darwin Kernel Version 8.11.1: '
(
'Darwin Kernel Version 8.11.1: '
'Wed Oct 10 18:23:28 PDT 2007; '
'Wed Oct 10 18:23:28 PDT 2007; '
...
@@ -295,7 +284,6 @@ class TestSysConfig(unittest.TestCase):
...
@@ -295,7 +284,6 @@ class TestSysConfig(unittest.TestCase):
self
.
assertIn
(
ldflags
,
ldshared
)
self
.
assertIn
(
ldflags
,
ldshared
)
@unittest.skipUnless
(
sys
.
platform
==
"darwin"
,
"test only relevant on MacOSX"
)
@unittest.skipUnless
(
sys
.
platform
==
"darwin"
,
"test only relevant on MacOSX"
)
def
test_platform_in_subprocess
(
self
):
def
test_platform_in_subprocess
(
self
):
my_platform
=
sysconfig
.
get_platform
()
my_platform
=
sysconfig
.
get_platform
()
...
@@ -321,7 +309,6 @@ class TestSysConfig(unittest.TestCase):
...
@@ -321,7 +309,6 @@ class TestSysConfig(unittest.TestCase):
self
.
assertEqual
(
status
,
0
)
self
.
assertEqual
(
status
,
0
)
self
.
assertEqual
(
my_platform
,
test_platform
)
self
.
assertEqual
(
my_platform
,
test_platform
)
# Test with MACOSX_DEPLOYMENT_TARGET in the environment, and
# Test with MACOSX_DEPLOYMENT_TARGET in the environment, and
# using a value that is unlikely to be the default one.
# using a value that is unlikely to be the default one.
env
=
os
.
environ
.
copy
()
env
=
os
.
environ
.
copy
()
...
@@ -342,8 +329,6 @@ class TestSysConfig(unittest.TestCase):
...
@@ -342,8 +329,6 @@ class TestSysConfig(unittest.TestCase):
self
.
assertEqual
(
my_platform
,
test_platform
)
self
.
assertEqual
(
my_platform
,
test_platform
)
def
test_main
():
def
test_main
():
run_unittest
(
TestSysConfig
)
run_unittest
(
TestSysConfig
)
...
...
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