From dcedc0d2f7c0fb4d837905a3e7787e4e3b2d8ba2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20O=C5=BCarowski?= <piotr@debian.org>
Date: Tue, 24 Jan 2012 22:07:28 +0100
Subject: [PATCH] pycompile: fix -O option

---
 debian/changelog | 6 +++++-
 pycompile        | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 22bc59b..05e9a01 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,13 @@
 python-defaults (2.7.2-10) unstable; urgency=low
 
-  * For argparse eggs, generate dependencies of the form
+  [ Matthias Klose ]
+  * dh_python2: For argparse eggs, generate dependencies of the form
     "python (>= 2.7) | python-argparse". Closes: #653644, #657119.
   * Regenerate pydist/dist_fallback.
 
+  [ Piotr Ożarowski ]
+  * pycompile: fix -O option
+
  -- Matthias Klose <doko@debian.org>  Tue, 24 Jan 2012 11:49:24 +0100
 
 python-defaults (2.7.2-9) unstable; urgency=low
diff --git a/pycompile b/pycompile
index 5b9cf85..99c5eb1 100755
--- a/pycompile
+++ b/pycompile
@@ -132,7 +132,7 @@ def py_compile(version, optimize, workers):
     if not isinstance(version, basestring):
         version = vrepr(version)
     cmd = "/usr/bin/python%s%s -m py_compile -" \
-        % (version, '' if (__debug__ or not optimize) else ' -O')
+        % (version, ' -O' if optimize else '')
     process = Popen(cmd, bufsize=1, shell=True,
                     stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
     workers[version] = process  # keep the reference for .communicate()
-- 
GitLab