diff options
author | Martin Panter <vadmium+py@gmail.com> | 2015-12-11 05:19:29 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2015-12-11 05:19:29 +0000 |
commit | b82032f935962d13220bba52d26ac607149485eb (patch) | |
tree | dd2b37f8a5c8f4e5621739c6f7c5b727727d9542 /Lib/gzip.py | |
parent | 7dda421bfff887da9a84e99c37ef1b0ef9f3cde9 (diff) | |
download | cpython-git-b82032f935962d13220bba52d26ac607149485eb.tar.gz |
Issue #22341: Drop Python 2 workaround and document CRC initial value
Also align the parameter naming in binascii to be consistent with zlib.
Diffstat (limited to 'Lib/gzip.py')
-rw-r--r-- | Lib/gzip.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index 45152e440d..3a2b322732 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -210,7 +210,7 @@ class GzipFile(_compression.BaseStream): def _init_write(self, filename): self.name = filename - self.crc = zlib.crc32(b"") & 0xffffffff + self.crc = zlib.crc32(b"") self.size = 0 self.writebuf = [] self.bufsize = 0 @@ -261,7 +261,7 @@ class GzipFile(_compression.BaseStream): if length > 0: self.fileobj.write(self.compress.compress(data)) self.size += length - self.crc = zlib.crc32(data, self.crc) & 0xffffffff + self.crc = zlib.crc32(data, self.crc) self.offset += length return length @@ -381,7 +381,7 @@ class _GzipReader(_compression.DecompressReader): self._last_mtime = None def _init_read(self): - self._crc = zlib.crc32(b"") & 0xffffffff + self._crc = zlib.crc32(b"") self._stream_size = 0 # Decompressed size of unconcatenated stream def _read_exact(self, n): @@ -485,7 +485,7 @@ class _GzipReader(_compression.DecompressReader): return uncompress def _add_read_data(self, data): - self._crc = zlib.crc32(data, self._crc) & 0xffffffff + self._crc = zlib.crc32(data, self._crc) self._stream_size = self._stream_size + len(data) def _read_eof(self): |