[Pkg-ocaml-maint-commits] [SCM] pkglab packaging branch, master, updated. debian/1.4.2-13-1-g4f4bc7e

Stefano Zacchiroli zack at debian.org
Wed Sep 5 11:32:42 UTC 2012


The following commit has been merged in the master branch:
commit 4f4bc7edebe76d8a1268ea1d6c8aadf7dd77ad45
Author: Stefano Zacchiroli <zack at debian.org>
Date:   Wed Sep 5 13:27:37 2012 +0200

    add-sources.py: use "in" syntax instead of "has_key"
    
    for forward compatibility with Python 3
    see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686731 for reference

diff --git a/debian/changelog b/debian/changelog
index 0d3d4dc..d15e3af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+pkglab (1.4.2-14) UNRELEASED; urgency=low
+
+  [ Stefano Zacchiroli ]
+  * add-sources.py: use "in" syntax instead of "has_key", for forward
+    compatibilty with Python 3 (See: #686731 for details)
+
+ -- Stefano Zacchiroli <zack at debian.org>  Wed, 05 Sep 2012 13:31:27 +0200
+
 pkglab (1.4.2-13) unstable; urgency=low
 
   [ Stéphane Glondu ]
diff --git a/debian/contrib/add-sources.py b/debian/contrib/add-sources.py
index 8bc5372..07a236a 100755
--- a/debian/contrib/add-sources.py
+++ b/debian/contrib/add-sources.py
@@ -76,7 +76,7 @@ def pkg_of_src(src):
         def get_rels(fields, relations):
             rels = []
             for name in fields:
-                if relations.has_key(name):
+                if name in relations:
                     rels.extend(relations[name])
             return rels
 
@@ -86,7 +86,7 @@ def pkg_of_src(src):
             """
             for dep in or_deps:
                 if dep['name'] in buildessentials \
-                        and not (dep.has_key('version') and dep['version']):
+                        and not ('version' in dep and dep['version']):
                     return True	# unversioned build-dep on a build-essential
             return False
 
@@ -112,16 +112,16 @@ def pkg_of_src(src):
                 return '!' + arch
         def pp_atomic_dep(dep):
             s = dep['name']
-            if dep.has_key('version') and dep['version'] is not None:
+            if 'version' in dep and dep['version'] is not None:
                 s += ' (%s %s)' % dep['version']
-            if dep.has_key('arch') and dep['arch'] is not None:
+            if 'arch' in dep and dep['arch'] is not None:
                 s += ' [%s]' % string.join(map(pp_arch, dep['arch']))
             return s
         pp_or_dep = lambda deps: string.join(map(pp_atomic_dep, deps), ' | ')
         return string.join(map(pp_or_dep, rels), ', ')
 
     for field in ['Version', 'Priority', 'Section', 'Maintainer', 'Architecture']:
-        if src.has_key(field):
+        if field in src:
             pkg[field] = src[field]
     bin_depends = mk_bin_rels(['build-depends', 'build-depends-indep'],
             src.relations)

-- 
pkglab packaging



More information about the Pkg-ocaml-maint-commits mailing list