# HG changeset patch # User Daniel Holth # Date 1374332376 14400 # Node ID 2c17870d689e0d3b94e8aa8b58086baf4b1bbfcf # Parent 6587fd3d89ae9a3f07a021b61da24bb3600736b2 lazily generate zipfile._ZipDecrypter.crctable diff -r 6587fd3d89ae -r 2c17870d689e Lib/zipfile.py --- a/Lib/zipfile.py Thu Jul 11 22:00:57 2013 +0300 +++ b/Lib/zipfile.py Sat Jul 20 10:59:36 2013 -0400 @@ -475,13 +475,15 @@ crc = ((crc >> 1) & 0x7FFFFFFF) table[i] = crc return table - crctable = _GenerateCRCTable() + crctable = None def _crc32(self, ch, crc): """Compute the CRC32 primitive on one byte.""" return ((crc >> 8) & 0xffffff) ^ self.crctable[(crc ^ ch) & 0xff] def __init__(self, pwd): + if not _ZipDecrypter.crctable: + _ZipDecrypter.crctable = _ZipDecrypter._GenerateCRCTable() self.key0 = 305419896 self.key1 = 591751049 self.key2 = 878082192