comparison mercurial/archival.py @ 44475:b7ca03dff14c stable

gzip: use the stdlib version with python 3 (issue6284) It turned out that the stdlib gained the feature we missed in python 3.1. We can now use it directly.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Mar 2020 18:54:44 +0100
parents a23b859ad17d
children f8427841c8fc
comparison
equal deleted inserted replaced
44474:a23b859ad17d 44475:b7ca03dff14c
133 133
134 class tarit(object): 134 class tarit(object):
135 '''write archive to tar file or stream. can write uncompressed, 135 '''write archive to tar file or stream. can write uncompressed,
136 or compress with gzip or bzip2.''' 136 or compress with gzip or bzip2.'''
137 137
138 if True: 138 if pycompat.ispy3:
139 GzipFileWithTime = gzip.GzipFile # camelcase-required
140 else:
139 141
140 class GzipFileWithTime(gzip.GzipFile): 142 class GzipFileWithTime(gzip.GzipFile):
141 def __init__(self, *args, **kw): 143 def __init__(self, *args, **kw):
142 timestamp = None 144 timestamp = None
143 if 'mtime' in kw: 145 if 'mtime' in kw: