diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2017-04-27 16:05:26 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-27 16:05:26 (GMT) |
commit | 5a4e3d8f9c37e700402b23fafbfc413e5ca3113d (patch) | |
tree | 56bfabdb9726d4fbab31ec1521ece25da42d23c3 /Lib/pickletools.py | |
parent | 5bccca58b9b2b3a925b16750bedbd907695ea8d7 (diff) | |
download | cpython-5a4e3d8f9c37e700402b23fafbfc413e5ca3113d.zip cpython-5a4e3d8f9c37e700402b23fafbfc413e5ca3113d.tar.gz cpython-5a4e3d8f9c37e700402b23fafbfc413e5ca3113d.tar.bz2 |
bpo-30174: Remove duplicate definition from pickletools (#1301)
There were two almost identical definitions of bytes1.
Diffstat (limited to 'Lib/pickletools.py')
-rw-r--r-- | Lib/pickletools.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py index 5e129b5..0c8dddc 100644 --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -493,35 +493,6 @@ bytes1 = ArgumentDescriptor( doc="""A counted bytes string. The first argument is a 1-byte unsigned int giving the number - of bytes in the string, and the second argument is that many - bytes. - """) - - -def read_bytes1(f): - r""" - >>> import io - >>> read_bytes1(io.BytesIO(b"\x00")) - b'' - >>> read_bytes1(io.BytesIO(b"\x03abcdef")) - b'abc' - """ - - n = read_uint1(f) - assert n >= 0 - data = f.read(n) - if len(data) == n: - return data - raise ValueError("expected %d bytes in a bytes1, but only %d remain" % - (n, len(data))) - -bytes1 = ArgumentDescriptor( - name="bytes1", - n=TAKEN_FROM_ARGUMENT1, - reader=read_bytes1, - doc="""A counted bytes string. - - The first argument is a 1-byte unsigned int giving the number of bytes, and the second argument is that many bytes. """) |