Author: Alex Gaynor <[email protected]>
Branch: stdlib-2.7.8
Changeset: r72993:505a10d18c25
Date: 2014-08-22 22:47 -0700
http://bitbucket.org/pypy/pypy/changeset/505a10d18c25/

Log:    Fixed a crash in BufferedRWPair

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
@@ -919,9 +919,17 @@
     @func_renamer(method + '_w')
     def method_w(self, space, __args__):
         if writer:
+            if self.w_writer is None:
+                raise OperationError(
+                    space.w_ValueError, "I/O operation on uninitialized object"
+                )
             w_meth = space.getattr(self.w_writer, space.wrap(method))
             w_result = space.call_args(w_meth, __args__)
         if reader:
+            if self.w_reader is None:
+                raise OperationError(
+                    space.w_ValueError, "I/O operation on uninitialized object"
+                )
             w_meth = space.getattr(self.w_reader, space.wrap(method))
             w_result = space.call_args(w_meth, __args__)
         return w_result
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to