mirror of https://github.com/python/cpython.git
Fix test_pickletools.py doctest's on 32-bit platforms. I hate doctests.
This commit is contained in:
parent
c1207c1bcf
commit
057e58dc01
|
@ -562,15 +562,16 @@ def read_bytes4(f):
|
||||||
|
|
||||||
def read_bytes8(f):
|
def read_bytes8(f):
|
||||||
r"""
|
r"""
|
||||||
>>> import io
|
>>> import io, struct, sys
|
||||||
>>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
|
>>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
|
||||||
b''
|
b''
|
||||||
>>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
|
>>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
|
||||||
b'abc'
|
b'abc'
|
||||||
>>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x03\x00abcdef"))
|
>>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
|
||||||
|
>>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef")) #doctest: +ELLIPSIS
|
||||||
Traceback (most recent call last):
|
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)
|
n = read_uint8(f)
|
||||||
|
|
Loading…
Reference in New Issue