Commit a4265546 authored by Brett Cannon's avatar Brett Cannon

Explicitly close a file to stop raising a ResourceWarning.

parent 087a2a95
...@@ -306,19 +306,20 @@ class TestSysConfig(unittest.TestCase): ...@@ -306,19 +306,20 @@ class TestSysConfig(unittest.TestCase):
env = os.environ.copy() env = os.environ.copy()
env['MACOSX_DEPLOYMENT_TARGET'] = '10.1' env['MACOSX_DEPLOYMENT_TARGET'] = '10.1'
p = subprocess.Popen([ with open('/dev/null') as dev_null:
sys.executable, '-c', p = subprocess.Popen([
'import sysconfig; print(sysconfig.get_platform())', sys.executable, '-c',
], 'import sysconfig; print(sysconfig.get_platform())',
stdout=subprocess.PIPE, ],
stderr=open('/dev/null'), stdout=subprocess.PIPE,
env=env) stderr=dev_null,
test_platform = p.communicate()[0].strip() env=env)
test_platform = test_platform.decode('utf-8') test_platform = p.communicate()[0].strip()
status = p.wait() test_platform = test_platform.decode('utf-8')
status = p.wait()
self.assertEqual(status, 0) self.assertEqual(status, 0)
self.assertEqual(my_platform, test_platform) self.assertEqual(my_platform, test_platform)
class MakefileTests(unittest.TestCase): class MakefileTests(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment