From: Stefan Behnel Date: Thu, 9 Sep 2010 06:40:40 +0000 (+0200) Subject: fix newline normalisation on stream.readlines() for Py<=2.5 X-Git-Tag: 0.14.alpha0~339 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e61034143ee881e3ff8a62f4fdb252b6503361c8;p=cython.git fix newline normalisation on stream.readlines() for Py<=2.5 --- 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