Patchwork [1,of,5] archival: drop self.filename - deprecated in py2.6

login
register
mail settings
Submitter timeless@mozdev.org
Date Sept. 9, 2015, 1 a.m.
Message ID <86cde82f7a356f189678.1441760457@waste.org>
Download mbox | patch
Permalink /patch/10425/
State Accepted
Headers show

Comments

timeless@mozdev.org - Sept. 9, 2015, 1 a.m.
# HG changeset patch
# User timeless@mozdev.org
# Date 1441360475 14400
#      Fri Sep 04 05:54:35 2015 -0400
# Node ID 86cde82f7a356f189678df401831646e32499522
# Parent  7187f6e923d55cf6b7e6910d24645f303db671ee
archival: drop self.filename - deprecated in py2.6

Patch

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -124,11 +124,7 @@ 
         def _write_gzip_header(self):
             self.fileobj.write('\037\213')             # magic header
             self.fileobj.write('\010')                 # compression method
-            # Python 2.6 introduced self.name and deprecated self.filename
-            try:
-                fname = self.name
-            except AttributeError:
-                fname = self.filename
+            fname = self.name
             if fname and fname.endswith('.gz'):
                 fname = fname[:-3]
             flags = 0