Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3.3
Changeset: r76317:abe327b7e4fc
Date: 2015-03-10 23:03 +0100
http://bitbucket.org/pypy/pypy/changeset/abe327b7e4fc/

Log:    Fix test_ztranslation of _io module

diff --git a/pypy/module/_io/interp_bufferedio.py 
b/pypy/module/_io/interp_bufferedio.py
--- a/pypy/module/_io/interp_bufferedio.py
+++ b/pypy/module/_io/interp_bufferedio.py
@@ -306,23 +306,22 @@
         with self.lock:
             if self._closed(space):
                 return
-        flush_exception = None
+        w_flush_exception = None
         try:
             space.call_method(self, "flush")
-        except OperationError as flush_exception:
-            pass
+        except OperationError as e:
+            w_flush_exception = e.get_w_value(space)
+            raise
         finally:
             with self.lock:
                 try:
                     space.call_method(self.w_raw, "close")
                 except OperationError as e:
-                    if flush_exception:
+                    if w_flush_exception:
                         space.setattr(e.get_w_value(space),
                                       space.wrap('__context__'),
-                                      flush_exception.get_w_value(space))
+                                      w_flush_exception)
                     raise
-            if flush_exception:
-                raise
 
     def _dealloc_warn_w(self, space, w_source):
         space.call_method(self.w_raw, "_dealloc_warn", w_source)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to