[pypy-svn] pypy default: Try to work at least a bit even if the module fcntl is not translated.

arigo commits-noreply at bitbucket.org
Mon Feb 14 18:30:44 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41913:f1c33fb37c9d
Date: 2011-02-14 17:25 +0100
http://bitbucket.org/pypy/pypy/changeset/f1c33fb37c9d/

Log:	Try to work at least a bit even if the module fcntl is not
	translated.

diff --git a/pypy/module/posix/app_posix.py b/pypy/module/posix/app_posix.py
--- a/pypy/module/posix/app_posix.py
+++ b/pypy/module/posix/app_posix.py
@@ -66,7 +66,10 @@
 
 if osname == 'posix':
     def _validate_fd(fd):
-        import fcntl
+        try:
+            import fcntl
+        except ImportError:
+            return
         try:
             fcntl.fcntl(fd, fcntl.F_GETFD)
         except IOError, e:


More information about the Pypy-commit mailing list