Author: Matti Picus <[email protected]>
Branch: cffi_dlopen_unicode
Changeset: r95189:943912f5c5dd
Date: 2018-10-08 17:34 +0300
http://bitbucket.org/pypy/pypy/changeset/943912f5c5dd/

Log:    skip unicode file test on non-windows

diff --git a/pypy/module/_cffi_backend/test/test_re_python.py 
b/pypy/module/_cffi_backend/test/test_re_python.py
--- a/pypy/module/_cffi_backend/test/test_re_python.py
+++ b/pypy/module/_cffi_backend/test/test_re_python.py
@@ -1,9 +1,13 @@
 import py
-import shutil
+import sys, shutil
 from rpython.tool.udir import udir
 from pypy.interpreter.gateway import interp2app
 from pypy.module._cffi_backend.newtype import _clean_cache
 
+if sys.platform == 'win32':
+    WIN32 = True
+else:
+    WIN32 = False
 
 class AppTestRecompilerPython:
     spaceconfig = dict(usemodules=['_cffi_backend'])
@@ -41,9 +45,11 @@
                             'globalconst42', 'globalconsthello'])
         outputfilename = ffiplatform.compile(str(tmpdir), ext)
         cls.w_extmod = space.wrap(outputfilename)
-        outputfileUname = unicode(udir.join(u'load\u03betest.dll'))
-        shutil.copyfile(outputfilename, outputfileUname)
-        cls.w_extmodU = space.wrap(outputfileUname)
+        if WIN32:
+            # non-windows need utf8 locales to deal with unicode filenames
+            outputfileUname = unicode(udir.join(u'load\u03betest.dll'))
+            shutil.copyfile(outputfilename, outputfileUname)
+            cls.w_extmodU = space.wrap(outputfileUname)
         #mod.tmpdir = tmpdir
         #
         ffi = FFI()
@@ -113,11 +119,12 @@
         assert type(lib.add42) is _cffi_backend.FFI.CData
 
     def test_dlopen_unicode(self):
-        import _cffi_backend
-        self.fix_path()
-        from re_python_pysrc import ffi
-        lib = ffi.dlopen(self.extmodU)
-        assert lib.add42(-10) == 32
+        if getattr(self, extmodU, None):
+            import _cffi_backend
+            self.fix_path()
+            from re_python_pysrc import ffi
+            lib = ffi.dlopen(self.extmodU)
+            assert lib.add42(-10) == 32
 
     def test_dlclose(self):
         import _cffi_backend
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to