Use sequence repetition instead of bytes constructor with integer argument.

This commit is contained in:
Serhiy Storchaka 2016-09-11 14:41:02 +03:00
parent ab8740058a
commit 5f1a5187f7
12 changed files with 20 additions and 20 deletions

View file

@ -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)