Author: Matti Picus <matti.pi...@gmail.com>
Branch: 
Changeset: r93816:fc85b98a24e2
Date: 2018-02-12 21:45 -0500
http://bitbucket.org/pypy/pypy/changeset/fc85b98a24e2/

Log:    raise IOError not OSError

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
@@ -91,7 +91,10 @@
         """fdopen(fd [, mode='r' [, buffering]]) -> file_object
 
         Return an open file object connected to a file descriptor."""
-        posix.fstat(fd)
+        try:
+            posix.fstat(fd)
+        except OSError as e:
+            raise IOError(e.errno, e.message)
         return _fdopen(fd, mode, buffering)
 
 else:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to