[pypy-svn] pypy default: Expose io.StringIO.errors

alex_gaynor commits-noreply at bitbucket.org
Mon Jan 31 08:56:38 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r41488:dac082b74440
Date: 2011-01-31 02:56 -0500
http://bitbucket.org/pypy/pypy/changeset/dac082b74440/

Log:	Expose io.StringIO.errors

diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -220,6 +220,9 @@
     def detach_w(self, space):
         self._unsupportedoperation(space, "detach")
 
+    def errors_get_w(space, self):
+        return space.w_None
+
 W_TextIOBase.typedef = TypeDef(
     '_TextIOBase', W_IOBase.typedef,
     __new__ = generic_new_descr(W_TextIOBase),
@@ -227,7 +230,8 @@
     read = interp2app(W_TextIOBase.read_w),
     readline = interp2app(W_TextIOBase.readline_w),
     detach = interp2app(W_TextIOBase.detach_w),
-    encoding = interp_attrproperty_w("w_encoding", W_TextIOBase)
+    encoding = interp_attrproperty_w("w_encoding", W_TextIOBase),
+    errors = GetSetProperty(W_TextIOBase.errors_get_w),
 )
 
 class PositionCookie:

diff --git a/pypy/module/_io/test/test_stringio.py b/pypy/module/_io/test/test_stringio.py
--- a/pypy/module/_io/test/test_stringio.py
+++ b/pypy/module/_io/test/test_stringio.py
@@ -22,6 +22,7 @@
         assert sio.seekable()
         raises(ValueError, sio.isatty)
         assert sio.closed
+        assert sio.errors is None
 
     def test_closed(self):
         import io


More information about the Pypy-commit mailing list