changeset 6495:3130c9ded04e

python-2.6: deprecation of GzipFile.filename
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 08 Apr 2008 15:42:43 +0200
parents 43d14cbd69b7
children 118720f857b9
files mercurial/archival.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/archival.py	Mon Apr 07 13:16:11 2008 +0200
+++ b/mercurial/archival.py	Tue Apr 08 15:42:43 2008 +0200
@@ -52,7 +52,8 @@
         def _write_gzip_header(self):
             self.fileobj.write('\037\213')             # magic header
             self.fileobj.write('\010')                 # compression method
-            fname = self.filename[:-3]
+            # Python 2.6 deprecates self.filename
+            fname = getattr(self, 'name', None) or self.filename 
             flags = 0
             if fname:
                 flags = gzip.FNAME