From 3d17fdad3bbb0f3f04b841212b5ea3010a78c1c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Wed, 28 Jul 2010 17:33:05 +0200
Subject: [PATCH] pycompile: compile public module for the right Python version
 (really closes: 590224)

---
 debian/changelog | 4 +++-
 pycompile        | 9 +++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8d24028..aed4e4d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
-python-defaults (2.6.5-11) UNRELEASED; urgency=low
+python-defaults (2.6.5-11) unstable; urgency=medium
 
   * Add README.PyDist to python-doc package
+  * pycompile: compile public module for the right Python version (really
+    closes: 590224)
 
  -- Piotr Ożarowski <piotr@debian.org>  Tue, 27 Jul 2010 21:25:54 +0200
 
diff --git a/pycompile b/pycompile
index 6ad8ec3..f70aa28 100755
--- a/pycompile
+++ b/pycompile
@@ -31,8 +31,9 @@ from os.path import abspath, exists, isdir, isfile, join
 from subprocess import PIPE, Popen
 sys.path.insert(1, '/usr/share/python/')
 from debpython.version import SUPPORTED, debsorted, vrepr, \
-        get_requested_versions, parse_vrange
+        get_requested_versions, parse_vrange, getver
 from debpython.option import Option, compile_regexpr
+from debpython.pydist import PUBLIC_DIR_RE
 from debpython.tools import memoize
 
 # initialize script
@@ -155,7 +156,11 @@ def filter_files(files, e_patterns, compile_versions):
             if not valid_versions:
                 break
         if valid_versions:
-            yield fn, valid_versions
+            public_dir = PUBLIC_DIR_RE.match(fn)
+            if public_dir:
+                yield fn, set([getver(public_dir.group(1))])
+            else:
+                yield fn, valid_versions
 
 
 ### COMPILE ####################################################
-- 
GitLab