mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Adapt platform and test_platform to the build identification changes.
This commit is contained in:
parent
1ca2e7965c
commit
8256242b30
2 changed files with 8 additions and 2 deletions
|
@ -51,11 +51,13 @@ class PlatformTest(unittest.TestCase):
|
|||
def setUp(self):
|
||||
self.save_version = sys.version
|
||||
self.save_subversion = sys.subversion
|
||||
self.save_mercurial = sys._mercurial
|
||||
self.save_platform = sys.platform
|
||||
|
||||
def tearDown(self):
|
||||
sys.version = self.save_version
|
||||
sys.subversion = self.save_subversion
|
||||
sys._mercurial = self.save_mercurial
|
||||
sys.platform = self.save_platform
|
||||
|
||||
def test_sys_version(self):
|
||||
|
@ -103,10 +105,12 @@ class PlatformTest(unittest.TestCase):
|
|||
sys_versions.items():
|
||||
sys.version = version_tag
|
||||
if subversion is None:
|
||||
if hasattr(sys, "_mercurial"):
|
||||
del sys._mercurial
|
||||
if hasattr(sys, "subversion"):
|
||||
del sys.subversion
|
||||
else:
|
||||
sys.subversion = subversion
|
||||
sys._mercurial = subversion
|
||||
if sys_platform is not None:
|
||||
sys.platform = sys_platform
|
||||
self.assertEqual(platform.python_implementation(), info[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue