[pypy-commit] pypy default: Fix test on windows

amauryfa noreply at buildbot.pypy.org
Thu Aug 18 00:18:07 CEST 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r46577:38ee1656d775
Date: 2011-08-18 00:06 +0200
http://bitbucket.org/pypy/pypy/changeset/38ee1656d775/

Log:	Fix test on windows

diff --git a/pypy/module/posix/test/test_posix2.py b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -271,8 +271,12 @@
         f.close()
 
         # Ensure that fcntl is not faked
-        import fcntl
-        assert fcntl.__file__.endswith('pypy/module/fcntl')
+        try:
+            import fcntl
+        except ImportError:
+            pass
+        else:
+            assert fcntl.__file__.endswith('pypy/module/fcntl')
         exc = raises(OSError, posix.fdopen, fd)
         assert exc.value.errno == errno.EBADF
 


More information about the pypy-commit mailing list