Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 559b5f1

Browse files
committed
Minor cleanup in sysconfig.
Also remove outdated and unhelpful docstrings in test_sysconfig.
1 parent 9bcfacd commit 559b5f1

2 files changed

Lines changed: 2 additions & 18 deletions

File tree

Lib/sysconfig.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,10 @@ def get_platform():
656656
# to. This makes the compatibility story a bit more sane because the
657657
# machine is going to compile and link as if it were
658658
# MACOSX_DEPLOYMENT_TARGET.
659-
#
660659
cfgvars = get_config_vars()
661660
macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET')
662661

663-
if 1:
662+
if True:
664663
# Always calculate the release of the running machine,
665664
# needed to determine if we can build fat binaries or not.
666665

@@ -755,7 +754,7 @@ def _main():
755754
print('Platform: "%s"' % get_platform())
756755
print('Python version: "%s"' % get_python_version())
757756
print('Current installation scheme: "%s"' % _get_default_scheme())
758-
print('')
757+
print()
759758
_print_dict('Paths', get_paths())
760759
print()
761760
_print_dict('Variables', get_config_vars())

Lib/test/test_sysconfig.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""Tests for 'site'.
2-
3-
Tests assume the initial paths in sys.path once the interpreter has begun
4-
executing have not been removed.
5-
6-
"""
71
import unittest
82
import sys
93
import os
@@ -23,7 +17,6 @@
2317
class TestSysConfig(unittest.TestCase):
2418

2519
def setUp(self):
26-
"""Make a copy of sys.path"""
2720
super(TestSysConfig, self).setUp()
2821
self.sys_path = sys.path[:]
2922
self.makefile = None
@@ -53,7 +46,6 @@ def setUp(self):
5346
self._added_envvars.append(var)
5447

5548
def tearDown(self):
56-
"""Restore sys.path"""
5749
sys.path[:] = self.sys_path
5850
if self.makefile is not None:
5951
os.unlink(self.makefile)
@@ -145,8 +137,6 @@ def test_get_platform(self):
145137
('Darwin Kernel Version 8.11.1: '
146138
'Wed Oct 10 18:23:28 PDT 2007; '
147139
'root:xnu-792.25.20~1/RELEASE_I386'), 'PowerPC'))
148-
149-
150140
get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
151141

152142
get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
@@ -161,7 +151,6 @@ def test_get_platform(self):
161151
finally:
162152
sys.maxsize = maxint
163153

164-
165154
self._set_uname(('Darwin', 'macziade', '8.11.1',
166155
('Darwin Kernel Version 8.11.1: '
167156
'Wed Oct 10 18:23:28 PDT 2007; '
@@ -295,7 +284,6 @@ def test_ldshared_value(self):
295284

296285
self.assertIn(ldflags, ldshared)
297286

298-
299287
@unittest.skipUnless(sys.platform == "darwin", "test only relevant on MacOSX")
300288
def test_platform_in_subprocess(self):
301289
my_platform = sysconfig.get_platform()
@@ -321,7 +309,6 @@ def test_platform_in_subprocess(self):
321309
self.assertEqual(status, 0)
322310
self.assertEqual(my_platform, test_platform)
323311

324-
325312
# Test with MACOSX_DEPLOYMENT_TARGET in the environment, and
326313
# using a value that is unlikely to be the default one.
327314
env = os.environ.copy()
@@ -342,8 +329,6 @@ def test_platform_in_subprocess(self):
342329
self.assertEqual(my_platform, test_platform)
343330

344331

345-
346-
347332
def test_main():
348333
run_unittest(TestSysConfig)
349334

0 commit comments

Comments
 (0)