diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-12 20:25:39 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-10-12 20:25:39 (GMT) |
commit | 1164dfcb86757ebaeb68276e4b8f6ee266c9968d (patch) | |
tree | 763f8772f413d230b2a56248ab5ecd28b6b0f1b1 /Lib | |
parent | 4c6ed25b9621c58d081f06660ca7f970836ec3c6 (diff) | |
download | cpython-1164dfcb86757ebaeb68276e4b8f6ee266c9968d.zip cpython-1164dfcb86757ebaeb68276e4b8f6ee266c9968d.tar.gz cpython-1164dfcb86757ebaeb68276e4b8f6ee266c9968d.tar.bz2 |
Issue #19219: Speed up marshal.loads(), and make pyc files slightly (5% to 10%) smaller.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_marshal.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index ab06237..255eb87 100644 --- a/Lib/test/test_marshal.py +++ b/Lib/test/test_marshal.py @@ -262,11 +262,11 @@ class BugsTestCase(unittest.TestCase): def test_bad_reader(self): class BadReader(io.BytesIO): - def read(self, n=-1): - b = super().read(n) + def readinto(self, buf): + n = super().readinto(buf) if n is not None and n > 4: - b += b' ' * 10**6 - return b + n += 10**6 + return n for value in (1.0, 1j, b'0123456789', '0123456789'): self.assertRaises(ValueError, marshal.load, BadReader(marshal.dumps(value))) |