mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +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
|
@ -357,10 +357,10 @@ class GzipFile(_compression.BaseStream):
|
|||
if offset < self.offset:
|
||||
raise OSError('Negative seek in write mode')
|
||||
count = offset - self.offset
|
||||
chunk = bytes(1024)
|
||||
chunk = b'\0' * 1024
|
||||
for i in range(count // 1024):
|
||||
self.write(chunk)
|
||||
self.write(bytes(count % 1024))
|
||||
self.write(b'\0' * (count % 1024))
|
||||
elif self.mode == READ:
|
||||
self._check_not_closed()
|
||||
return self._buffer.seek(offset, whence)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue