diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-04-09 21:36:29 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-04-09 21:36:29 +0200 |
commit | db0361e668cf0148aa0fe5a20ccdd17f75a9069f (patch) | |
tree | 9c404ea86f82b9f74ebb3f4810e479024cb8eabc | |
parent | 989085485681e2457ce28acc7682b18a117cbb4f (diff) | |
download | cython-db0361e668cf0148aa0fe5a20ccdd17f75a9069f.tar.gz |
Try to fix unicode print output in "unicode_imports" test on Windows with Py2. (Previously failed in appveyor.)
-rw-r--r-- | tests/run/unicode_imports.srctree | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/run/unicode_imports.srctree b/tests/run/unicode_imports.srctree index 44fc64bb0..1c12c1681 100644 --- a/tests/run/unicode_imports.srctree +++ b/tests/run/unicode_imports.srctree @@ -7,8 +7,7 @@ PYTHON -m mydoctest ########### mydoctest.py ####### import sys -if (sys.version_info[0] < 3 or - (sys.version_info[0] == 3 and sys.version_info[1] < 5)): +if sys.version_info < (3, 5): # The module is only Cythonized and not build for these versions # so don't run the tests exit() @@ -28,6 +27,16 @@ exit(val) from __future__ import unicode_literals import sys + +# enable Unicode console output, if possible +if sys.platform == "win32" and sys.version_info < (3, 6): + try: + import win_unicode_console + except ImportError: + pass + else: + win_unicode_console.enable() + from Cython.Build import cythonize files = ["mymoð.pyx", "from_cy.pyx"] |