Author: Amaury Forgeot d'Arc <[email protected]>
Branch: stdlib-3.2.5
Changeset: r70407:c3d1b11d8ccd
Date: 2014-04-02 22:20 +0200
http://bitbucket.org/pypy/pypy/changeset/c3d1b11d8ccd/

Log:    CPython 3.2.5 seems to be more careful when unwrapping file
        descriptors. Do the same in pypy, and don't turn OverflowErrors into
        ValueErrors.

        This will fix a failure in test_fcntl, but will probably break other
        tests. Need to watch buildbot.

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1606,13 +1606,7 @@
                 raise OperationError(self.w_TypeError,
                     self.wrap("fileno() returned a non-integer")
                 )
-        try:
-            fd = self.c_int_w(w_fd)
-        except OperationError, e:
-            if e.match(self, self.w_OverflowError):
-                fd = -1
-            else:
-                raise
+        fd = self.c_int_w(w_fd)  # Can raise w_OverflowError
         if fd < 0:
             raise oefmt(self.w_ValueError,
                 "file descriptor cannot be a negative integer (%d)", fd)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to