Commit f81c75f4 authored by Stefan Behnel's avatar Stefan Behnel

Py2/3 portability fixes in test runner

parent 77bf40fa
...@@ -407,6 +407,7 @@ class CythonRunTestCase(CythonCompileTestCase): ...@@ -407,6 +407,7 @@ class CythonRunTestCase(CythonCompileTestCase):
child_id = os.fork() child_id = os.fork()
if not child_id: if not child_id:
result_code = 0 result_code = 0
try:
try: try:
output = os.fdopen(result_handle, 'wb') output = os.fdopen(result_handle, 'wb')
tests = None tests = None
...@@ -741,7 +742,12 @@ if __name__ == '__main__': ...@@ -741,7 +742,12 @@ if __name__ == '__main__':
''') ''')
sys.path.insert(0, cy3_dir) sys.path.insert(0, cy3_dir)
elif sys.version_info[0] >= 3: elif sys.version_info[0] >= 3:
# make sure we do not import (or run) Cython itself # make sure we do not import (or run) Cython itself (unless
# 2to3 was already run)
cy3_dir = os.path.join(WORKDIR, 'Cy3')
if os.path.isdir(cy3_dir):
sys.path.insert(0, cy3_dir)
else:
options.with_cython = False options.with_cython = False
options.doctests = False options.doctests = False
options.unittests = False options.unittests = False
......
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