[pypy-commit] pypy virtual-arguments: another one
fijal
noreply at buildbot.pypy.org
Wed Jul 18 16:26:04 CEST 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: virtual-arguments
Changeset: r56165:7bbdd564ee01
Date: 2012-07-18 16:25 +0200
http://bitbucket.org/pypy/pypy/changeset/7bbdd564ee01/
Log: another one
diff --git a/pypy/module/_io/interp_stringio.py b/pypy/module/_io/interp_stringio.py
--- a/pypy/module/_io/interp_stringio.py
+++ b/pypy/module/_io/interp_stringio.py
@@ -113,8 +113,9 @@
def resize_buffer(self, newlength):
if len(self.buf) > newlength:
self.buf = self.buf[:newlength]
- if len(self.buf) < newlength:
- self.buf.extend([u'\0'] * (newlength - len(self.buf)))
+ lgt = newlength - len(self.buf)
+ if lgt > 0:
+ self.buf.extend([u'\0'] * lgt)
def write(self, string):
length = len(string)
More information about the pypy-commit
mailing list