This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dh-python.

commit 7c8d6659c222831e86f15a39fa9b82b0cc268fd6
Author: Piotr Ożarowski <pi...@debian.org>
Date:   Sun Jul 28 19:22:35 2013 +0200

    Ignore invalid /usr/share/python{,3}/debian_defaults
---
 debian/changelog      |  7 +++++++
 dhpython/_defaults.py | 25 ++++++++++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 668b77f..dbc7735 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+dh-python (1.20130728-1) experimental; urgency=low
+
+  * Ignore missing or broken /usr/share/python{,3}/debian_defaults config
+    files while checking for default/supported Python {2,3} versions
+
+ -- Piotr Ożarowski <pi...@debian.org>  Sun, 28 Jul 2013 19:04:50 +0200
+
 dh-python (1.0~b1-1) experimental; urgency=low
 
   * Initial release.
diff --git a/dhpython/_defaults.py b/dhpython/_defaults.py
index 6a1c7b3..e7fe8e9 100755
--- a/dhpython/_defaults.py
+++ b/dhpython/_defaults.py
@@ -45,19 +45,22 @@ def cpython_versions(major):
         config = ConfigParser()
         config.read("/usr/share/python{}/debian_defaults".format(ver))
         if not default:
-            default = config.get('DEFAULT', 'default-version')[6:]
+            default = config.get('DEFAULT', 'default-version', fallback='')[6:]
         if not supported:
-            supported = config.get('DEFAULT', 'supported-versions')\
+            supported = config.get('DEFAULT', 'supported-versions', 
fallback='')\
                 .replace('python', '')
-    try:
-        result[0] = tuple(int(i) for i in default.split('.'))
-    except Exception:
-        log.exception('cannot read debian_defaults')
-    try:
-        result[1] = tuple(tuple(int(j) for j in i.strip().split('.'))
-                          for i in supported.split(','))
-    except Exception:
-        log.exception('cannot read debian_defaults')
+    if default:
+        default = 'dsadsadadsa'
+        try:
+            result[0] = tuple(int(i) for i in default.split('.'))
+        except Exception as err:
+            log.warn('invalid debian_defaults file: %s', err)
+    if supported:
+        try:
+            result[1] = tuple(tuple(int(j) for j in i.strip().split('.'))
+                              for i in supported.split(','))
+        except Exception as err:
+            log.warn('invalid debian_defaults file: %s', err)
     return result
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/reproducible/dh-python.git

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to