##// END OF EJS Templates
archival: simplify code and drop message about Python 2.5
Augie Fackler -
r30479:798bcb12 default
parent child Browse files
Show More
@@ -141,7 +141,7 class tarit(object):
141 141 self.mtime = mtime
142 142 self.fileobj = None
143 143
144 def taropen(name, mode, fileobj=None):
144 def taropen(mode, name='', fileobj=None):
145 145 if kind == 'gz':
146 146 mode = mode[0]
147 147 if not fileobj:
@@ -155,10 +155,9 class tarit(object):
155 155 return tarfile.open(name, mode + kind, fileobj)
156 156
157 157 if isinstance(dest, str):
158 self.z = taropen(dest, mode='w:')
158 self.z = taropen('w:', name=dest)
159 159 else:
160 # Python 2.5-2.5.1 have a regression that requires a name arg
161 self.z = taropen(name='', mode='w|', fileobj=dest)
160 self.z = taropen('w|', fileobj=dest)
162 161
163 162 def addfile(self, name, mode, islink, data):
164 163 i = tarfile.TarInfo(name)
General Comments 0
You need to be logged in to leave comments. Login now