diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 11:41:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 11:41:02 (GMT) |
commit | 5f1a5187f72acb75d59fa67286ecf5c186bae619 (patch) | |
tree | c5bca32d17d3251b8887ddaa10273a7df19a0eaa /Lib/gzip.py | |
parent | ab8740058a7f76f1438dc18a2ffd918da4f8118d (diff) | |
download | cpython-5f1a5187f72acb75d59fa67286ecf5c186bae619.zip cpython-5f1a5187f72acb75d59fa67286ecf5c186bae619.tar.gz cpython-5f1a5187f72acb75d59fa67286ecf5c186bae619.tar.bz2 |
Use sequence repetition instead of bytes constructor with integer argument.
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r-- | Lib/gzip.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index da4479e..ddf7668 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -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) |