[Python-checkins] r67820 - in sandbox/trunk/io-c: _textio.c io.py

amaury.forgeotdarc python-checkins at python.org
Wed Dec 17 02:16:23 CET 2008


Author: amaury.forgeotdarc
Date: Wed Dec 17 02:16:23 2008
New Revision: 67820

Log:
Force the tests to use our new C implementation
This reveals that the IncrementalNewlineDecoder is really needed now.


Modified:
   sandbox/trunk/io-c/_textio.c
   sandbox/trunk/io-c/io.py

Modified: sandbox/trunk/io-c/_textio.c
==============================================================================
--- sandbox/trunk/io-c/_textio.c	(original)
+++ sandbox/trunk/io-c/_textio.c	Wed Dec 17 02:16:23 2008
@@ -140,7 +140,7 @@
 	/* XXX only AttributeError and UnsupportedOperation */
 	if (self->encoding == NULL)
 	    PyErr_Clear();
-	if (!PyUnicode_Check(self->encoding))
+	else if (!PyUnicode_Check(self->encoding))
 	    Py_CLEAR(self->encoding);
     }
     if (encoding == NULL && self->encoding == NULL) {

Modified: sandbox/trunk/io-c/io.py
==============================================================================
--- sandbox/trunk/io-c/io.py	(original)
+++ sandbox/trunk/io-c/io.py	Wed Dec 17 02:16:23 2008
@@ -1366,7 +1366,8 @@
                )[self.seennl]
 
 
-class TextIOWrapper(TextIOBase):
+TextIOWrapper = _io.TextIOWrapper
+class unusedTextIOWrapper(TextIOBase):
 
     r"""Character and line based layer over a BufferedIOBase object, buffer.
 
@@ -1846,7 +1847,7 @@
     def newlines(self):
         return self._decoder.newlines if self._decoder else None
 
-class _StringIO(TextIOWrapper):
+class unused_StringIO(TextIOWrapper):
     """Text I/O implementation using an in-memory buffer.
 
     The initial_value argument sets the value of object.  The newline


More information about the Python-checkins mailing list