Use has_key
authorGuido Günther <agx@sigxcpu.org>
Thu, 27 Jun 2013 17:14:38 +0000 (19:14 +0200)
committerGuido Günther <agx@sigxcpu.org>
Thu, 27 Jun 2013 17:14:38 +0000 (19:14 +0200)
It's shorter and get's rid of the unused dummy variable.

gbp/scripts/buildpackage.py

index 9f8d578..b815c55 100755 (executable)
@@ -289,9 +289,7 @@ def guess_comp_type(repo, comp_type, cp, tarball_dir):
 
     if comp_type != 'auto':
         comp_type = compressor_aliases.get(comp_type, comp_type)
-        try:
-            dummy = compressor_opts[comp_type]
-        except KeyError:
+        if not compressor_opts.has_key(comp_type):
             gbp.log.warn("Unknown compression type - guessing.")
             comp_type = 'auto'