bug 439050, follow-up patch to close in MozZipFile, make python 2.3 happy, r=ted, djc

This commit is contained in:
Axel Hecht 2008-09-22 11:37:07 +02:00
parent a99e4a04e0
commit 3598f9878f
2 changed files with 8 additions and 1 deletions

View File

@ -403,7 +403,11 @@ def main():
noise = logging.INFO
if options.verbose is not None:
noise = (options.verbose and logging.DEBUG) or logging.WARN
logging.basicConfig(level = noise, format = "%(message)s")
if sys.version_info[:2] > (2,3):
logging.basicConfig(format = "%(message)s")
else:
logging.basicConfig()
logging.getLogger().setLevel(noise)
if not args:
jm.makeJar(infile=sys.stdin,
sourcedirs=options.s, topsourcedir=options.t,

View File

@ -138,6 +138,9 @@ class ZipFile(zipfile.ZipFile):
all = map(lambda zi: (zi, True), self.filelist) + \
map(lambda zi: (zi, False), self._remove)
all.sort(lambda l, r: cmp(l[0].header_offset, r[0].header_offset))
# empty _remove for multiple closes
self._remove = []
lengths = [all[i+1][0].header_offset - all[i][0].header_offset
for i in xrange(len(all)-1)]
lengths.append(self.end - all[-1][0].header_offset)