##// 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 b' class tarit(object):'
141 self.mtime = mtime
141 self.mtime = mtime
142 self.fileobj = None
142 self.fileobj = None
143
143
144 def taropen(name, mode, fileobj=None):
144 def taropen(mode, name='', fileobj=None):
145 if kind == 'gz':
145 if kind == 'gz':
146 mode = mode[0]
146 mode = mode[0]
147 if not fileobj:
147 if not fileobj:
@@ -155,10 +155,9 b' class tarit(object):'
155 return tarfile.open(name, mode + kind, fileobj)
155 return tarfile.open(name, mode + kind, fileobj)
156
156
157 if isinstance(dest, str):
157 if isinstance(dest, str):
158 self.z = taropen(dest, mode='w:')
158 self.z = taropen('w:', name=dest)
159 else:
159 else:
160 # Python 2.5-2.5.1 have a regression that requires a name arg
160 self.z = taropen('w|', fileobj=dest)
161 self.z = taropen(name='', mode='w|', fileobj=dest)
162
161
163 def addfile(self, name, mode, islink, data):
162 def addfile(self, name, mode, islink, data):
164 i = tarfile.TarInfo(name)
163 i = tarfile.TarInfo(name)
General Comments 0
You need to be logged in to leave comments. Login now