From af27c4e1eb3d9b333c6f2d6fafddcc91310223bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Thu, 17 Feb 2011 19:26:16 +0100
Subject: [PATCH] fix checking shebangs in private directories (executable bit
 wasn't checked correctly)

---
 debian/changelog | 2 ++
 dh_python2       | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 8a96a5e..989a26c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ python-defaults (2.6.6-11) UNRELEASED; urgency=low
     - replace a file with a symlink also if there's a matching one in
       pyshared directory already
     - add support for DH_OPTIONS env. variable
+    - fix checking shebangs in private directories (executable bit wasn't
+      checked correctly)
   * pycompile:
     - --exclude now works with private dirs
     - use /usr/bin/pythonX.Y rather than pythonX.Y (to avoid /usr/local
diff --git a/dh_python2 b/dh_python2
index dac6fa4..d760290 100755
--- a/dh_python2
+++ b/dh_python2
@@ -373,7 +373,7 @@ def scan(package, dname=None):
 
             elif private_dir:
                 mode = os.stat(join(root, fn))[ST_MODE]
-                if mode is S_IXUSR or mode is S_IXGRP or mode is S_IXOTH:
+                if mode & S_IXUSR or mode & S_IXGRP or mode & S_IXOTH:
                     res = shebang2pyver(join(root, fn))
                     if res:
                         r['private_dirs'].setdefault(private_dir, {})\
-- 
GitLab