From: Antoine Pitrou Date: Wed, 14 Oct 2009 18:12:54 +0000 (+0000) Subject: Fix a py3k warning in the StringIO module (exhibited in test_codecencodings_cn) X-Git-Tag: v2.7a1~356 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e08dd117fa687a132609328bc87666b1c814d1cc;p=python Fix a py3k warning in the StringIO module (exhibited in test_codecencodings_cn) --- diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 232009fb93..054ad4c3d5 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py @@ -128,7 +128,7 @@ class StringIO: if self.buflist: self.buf += ''.join(self.buflist) self.buflist = [] - if n < 0: + if n is None or n < 0: newpos = self.len else: newpos = min(self.pos+n, self.len)