summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-10-14 18:12:54 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-10-14 18:12:54 (GMT)
commite08dd117fa687a132609328bc87666b1c814d1cc (patch)
tree4838432c16d64e2937b5271b35cbd52a65e2704b
parente22997ec7c507423f597474c75d2459e5b30b063 (diff)
downloadcpython-e08dd117fa687a132609328bc87666b1c814d1cc.zip
cpython-e08dd117fa687a132609328bc87666b1c814d1cc.tar.gz
cpython-e08dd117fa687a132609328bc87666b1c814d1cc.tar.bz2
Fix a py3k warning in the StringIO module (exhibited in test_codecencodings_cn)
-rw-r--r--Lib/StringIO.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/StringIO.py b/Lib/StringIO.py
index 232009f..054ad4c 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)