From: Gregory P. Smith Date: Sat, 23 Nov 2013 20:40:46 +0000 (+0000) Subject: Fix test_pickletools.py doctest's on 32-bit platforms. I hate doctests. X-Git-Tag: v3.4.0b1~42^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=057e58dc01f7b1aa7fa847ffe53f742c13ee70a3;p=thirdparty%2FPython%2Fcpython.git Fix test_pickletools.py doctest's on 32-bit platforms. I hate doctests. --- diff --git a/Lib/pickletools.py b/Lib/pickletools.py index d711bf0490e5..74b65cea7175 100644 --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -562,15 +562,16 @@ bytes4 = ArgumentDescriptor( def read_bytes8(f): r""" - >>> import io + >>> import io, struct, sys >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc")) b'' >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef")) b'abc' - >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x03\x00abcdef")) + >>> bigsize8 = struct.pack(">> read_bytes8(io.BytesIO(bigsize8 + b"abcdef")) #doctest: +ELLIPSIS Traceback (most recent call last): ... - ValueError: expected 844424930131968 bytes in a bytes8, but only 6 remain + ValueError: expected ... bytes in a bytes8, but only 6 remain """ n = read_uint8(f)