From e61034143ee881e3ff8a62f4fdb252b6503361c8 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 9 Sep 2010 08:40:40 +0200 Subject: [PATCH] fix newline normalisation on stream.readlines() for Py<=2.5 --- Cython/Utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cython/Utils.py b/Cython/Utils.py index 554067fc..d319ac06 100644 --- a/Cython/Utils.py +++ b/Cython/Utils.py @@ -106,7 +106,7 @@ normalise_newlines = re.compile(u'\r\n?|\n').sub class NormalisedNewlineStream(object): """The codecs module doesn't provide universal newline support. This class is used as a stream wrapper that provides this - functionality. The new 'io' in Py2.6+/3.1+ supports this out of the + functionality. The new 'io' in Py2.6+/3.x supports this out of the box. """ def __init__(self, stream): @@ -126,10 +126,10 @@ class NormalisedNewlineStream(object): def readlines(self): content = [] - data = self._read(0x1000) + data = self.read(0x1000) while data: content.append(data) - data = self._read(0x1000) + data = self.read(0x1000) return u''.join(content).split(u'\n') io = None -- 2.26.2