Show More
@@ -74,8 +74,11 b' class tarit(object):' | |||||
74 | def _write_gzip_header(self): |
|
74 | def _write_gzip_header(self): | |
75 | self.fileobj.write('\037\213') # magic header |
|
75 | self.fileobj.write('\037\213') # magic header | |
76 | self.fileobj.write('\010') # compression method |
|
76 | self.fileobj.write('\010') # compression method | |
77 |
# Python 2.6 deprecate |
|
77 | # Python 2.6 introduced self.name and deprecated self.filename | |
78 | fname = getattr(self, 'name', None) or self.filename |
|
78 | try: | |
|
79 | fname = self.name | |||
|
80 | except AttributeError: | |||
|
81 | fname = self.filename | |||
79 | if fname and fname.endswith('.gz'): |
|
82 | if fname and fname.endswith('.gz'): | |
80 | fname = fname[:-3] |
|
83 | fname = fname[:-3] | |
81 | flags = 0 |
|
84 | flags = 0 |
General Comments 0
You need to be logged in to leave comments.
Login now