From 3ef32e2a51dd8bdcb904ccd8f33683149a55916a Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 19 Feb 2015 16:02:23 +0100 Subject: Don't use dict.has_key() Not existent in Python3 --- gbp/deb/changelog.py | 2 +- gbp/patch_series.py | 2 +- gbp/scripts/buildpackage.py | 2 +- gbp/scripts/import_dsc.py | 2 +- gbp/scripts/import_dscs.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'gbp') diff --git a/gbp/deb/changelog.py b/gbp/deb/changelog.py index 631b5a6..725e8ba 100644 --- a/gbp/deb/changelog.py +++ b/gbp/deb/changelog.py @@ -168,7 +168,7 @@ class ChangeLog(object): @return: C{True} if the version has an epoch, C{False} otherwise @rtype: C{bool} """ - return self._cp.has_key('Epoch') + return 'Epoch' in self._cp @property def author(self): diff --git a/gbp/patch_series.py b/gbp/patch_series.py index 327997f..ca45cab 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -130,7 +130,7 @@ class Patch(object): if self.info == None: self._read_info() - if self.info.has_key(key): + if key in self.info: return self.info[key] else: return get_val() if get_val else None diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 0eff515..419f01d 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -293,7 +293,7 @@ def guess_comp_type(repo, comp_type, cp, tarball_dir): if comp_type != 'auto': comp_type = compressor_aliases.get(comp_type, comp_type) - if not compressor_opts.has_key(comp_type): + if comp_type not in compressor_opts: gbp.log.warn("Unknown compression type - guessing.") comp_type = 'auto' diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py index 4c5747e..3f10d3f 100644 --- a/gbp/scripts/import_dsc.py +++ b/gbp/scripts/import_dsc.py @@ -412,7 +412,7 @@ def main(argv): os.chdir(dirs['top']) for d in [ 'tmp', 'download' ]: - if dirs.has_key(d): + if d in dirs: gbpc.RemoveTree(dirs[d])() if not ret and not skipped: diff --git a/gbp/scripts/import_dscs.py b/gbp/scripts/import_dscs.py index 440cec2..4e445c3 100644 --- a/gbp/scripts/import_dscs.py +++ b/gbp/scripts/import_dscs.py @@ -159,7 +159,7 @@ def main(argv): gbp.log.err(err) ret = 1 finally: - if dirs.has_key('tmp'): + if 'tmp' in dirs: gbpc.RemoveTree(dirs['tmp'])() os.chdir(dirs['top']) -- cgit v1.2.3