From 71ff48ea48d3d3e29f46a22fe206a7a1ee3b3a56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Tue, 24 Jan 2012 22:48:06 +0100
Subject: [PATCH] dh_python2: do not try to add python2.X dependency if private
 dir works with all Python versions

---
 debian/changelog     | 2 ++
 debpython/depends.py | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 05e9a01..fac67b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ python-defaults (2.7.2-10) unstable; urgency=low
 
   [ Piotr Ożarowski ]
   * pycompile: fix -O option
+  * dh_python2: do not try to add python2.X dependency if private dir works
+    with all Python versions
 
  -- Matthias Klose <doko@debian.org>  Tue, 24 Jan 2012 11:49:24 +0100
 
diff --git a/debpython/depends.py b/debpython/depends.py
index ba12687..ec286b7 100644
--- a/debpython/depends.py
+++ b/debpython/depends.py
@@ -143,7 +143,9 @@ class Dependencies(object):
                     # are scripts for different Python versions: compile with
                     # default Python version (or the one requested via X-P-V)
                     args += "-V %s" % vrange_str(vr)
-                    if vr[0] == vr[1]:
+                    if vr == (None, None):
+                        pass
+                    elif vr[0] == vr[1]:
                         self.depend("python%s" % vrepr(vr[0]))
                     else:
                         if vr[0]:  # minimum version specified
-- 
GitLab