[python-debian/master 27/36] Only define DebPart.has_key method for Python 2.
Colin Watson
cjwatson at canonical.com
Mon Oct 8 07:41:23 UTC 2012
---
lib/debian/debfile.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/debian/debfile.py b/lib/debian/debfile.py
index dba55f2..da8c738 100644
--- a/lib/debian/debfile.py
+++ b/lib/debian/debfile.py
@@ -19,6 +19,7 @@ from __future__ import absolute_import, print_function
import gzip
import tarfile
+import sys
from debian.arfile import ArFile, ArError
from debian.changelog import Changelog
@@ -135,8 +136,9 @@ class DebPart(object):
def __contains__(self, fname):
return self.has_file(fname)
- def has_key(self, fname):
- return self.has_file(fname)
+ if sys.version < '3':
+ def has_key(self, fname):
+ return self.has_file(fname)
def __getitem__(self, fname):
return self.get_content(fname)
--
1.7.2.5
More information about the pkg-python-debian-commits
mailing list