mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Use sequence repetition instead of bytes constructor with integer argument.
This commit is contained in:
parent
ab8740058a
commit
5f1a5187f7
12 changed files with 20 additions and 20 deletions
|
|
@ -707,7 +707,7 @@ def read_unicodestring8(f):
|
|||
>>> enc = s.encode('utf-8')
|
||||
>>> enc
|
||||
b'abcd\xea\xaf\x8d'
|
||||
>>> n = bytes([len(enc)]) + bytes(7) # little-endian 8-byte length
|
||||
>>> n = bytes([len(enc)]) + b'\0' * 7 # little-endian 8-byte length
|
||||
>>> t = read_unicodestring8(io.BytesIO(n + enc + b'junk'))
|
||||
>>> s == t
|
||||
True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue