Commit cfbd88a2 authored by Stefan Behnel's avatar Stefan Behnel

try fixing test runner output when sys.stderr is replaced

parent e8c85867
...@@ -836,7 +836,7 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -836,7 +836,7 @@ class CythonCompileTestCase(unittest.TestCase):
finally: finally:
sys.stderr = old_stderr sys.stderr = old_stderr
tostderr = sys.stderr.write tostderr = sys.__stderr__.write
if 'cerror' in self.tags['tag']: if 'cerror' in self.tags['tag']:
if errors: if errors:
tostderr("\n=== Expected C compile error ===\n") tostderr("\n=== Expected C compile error ===\n")
...@@ -885,11 +885,11 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -885,11 +885,11 @@ class CythonCompileTestCase(unittest.TestCase):
stdout = get_stdout and get_stdout().strip() stdout = get_stdout and get_stdout().strip()
if stdout: if stdout:
tostderr("\n=== C/C++ compiler output: ===\n") tostderr("\n=== C/C++ compiler output: ===\n")
print_bytes(stdout, end=None, file=sys.stderr) print_bytes(stdout, end=None, file=sys.__stderr__)
stderr = get_stderr and get_stderr().strip() stderr = get_stderr and get_stderr().strip()
if stderr: if stderr:
tostderr("\n=== C/C++ compiler error output: ===\n") tostderr("\n=== C/C++ compiler error output: ===\n")
print_bytes(stderr, end=None, file=sys.stderr) print_bytes(stderr, end=None, file=sys.__stderr__)
if stdout or stderr: if stdout or stderr:
tostderr("\n==============================\n") tostderr("\n==============================\n")
return so_path return so_path
......
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