Commit db2eb84f authored by Stefan Behnel's avatar Stefan Behnel

properly open and close source file in test runner when parsing distutils flags

parent 41b7184c
......@@ -850,8 +850,10 @@ class CythonCompileTestCase(unittest.TestCase):
if 'distutils' in self.tags:
from Cython.Build.Dependencies import DistutilsInfo
from Cython.Utils import open_source_file
pyx_path = os.path.join(self.test_directory, self.module + ".pyx")
DistutilsInfo(open(pyx_path)).apply(extension)
with open_source_file(pyx_path) as f:
DistutilsInfo(f).apply(extension)
for matcher, fixer in list(EXT_EXTRAS.items()):
if isinstance(matcher, str):
......
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