mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Rename buffer -> bytearray.
This commit is contained in:
parent
905a904723
commit
254348e201
31 changed files with 290 additions and 290 deletions
|
@ -56,7 +56,7 @@ class BinASCIITest(unittest.TestCase):
|
|||
a = binascii.b2a_base64(b)
|
||||
lines.append(a)
|
||||
|
||||
fillers = buffer()
|
||||
fillers = bytearray()
|
||||
valid = b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/"
|
||||
for i in range(256):
|
||||
if i not in valid:
|
||||
|
@ -64,7 +64,7 @@ class BinASCIITest(unittest.TestCase):
|
|||
def addnoise(line):
|
||||
noise = fillers
|
||||
ratio = len(line) // len(noise)
|
||||
res = buffer()
|
||||
res = bytearray()
|
||||
while line and noise:
|
||||
if len(line) // len(noise) > ratio:
|
||||
c, line = line[0], line[1:]
|
||||
|
@ -72,7 +72,7 @@ class BinASCIITest(unittest.TestCase):
|
|||
c, noise = noise[0], noise[1:]
|
||||
res.append(c)
|
||||
return res + noise + line
|
||||
res = buffer()
|
||||
res = bytearray()
|
||||
for line in map(addnoise, lines):
|
||||
b = binascii.a2b_base64(line)
|
||||
res += b
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue