Author: Armin Rigo <[email protected]>
Branch:
Changeset: r46158:c5ebf30f4485
Date: 2011-08-01 16:51 +0200
http://bitbucket.org/pypy/pypy/changeset/c5ebf30f4485/
Log: Fix for the case of read(-1).
diff --git a/pypy/module/_multibytecodec/app_multibytecodec.py
b/pypy/module/_multibytecodec/app_multibytecodec.py
--- a/pypy/module/_multibytecodec/app_multibytecodec.py
+++ b/pypy/module/_multibytecodec/app_multibytecodec.py
@@ -13,13 +13,11 @@
return self
def __read(self, read, size):
+ if size is None or size < 0:
+ return MultibyteIncrementalDecoder.decode(self, read(), True)
while True:
- if size is None:
- data = read()
- final = True
- else:
- data = read(size)
- final = not data
+ data = read(size)
+ final = not data
output = MultibyteIncrementalDecoder.decode(self, data, final)
if output or final:
return output
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit