File: 30_ppworker_invoke_via-m.patch

package info (click to toggle)
parallelpython 1.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 400 kB
  • sloc: python: 1,459; makefile: 35
file content (26 lines) | stat: -rw-r--r-- 868 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Yaroslav Halchenko <debian@onerussian.com>
Author: Jakub Wilk <jwilk@debian.org>
Subject: Do not invoke ppworker script directory -- run it via -m option of python

 Invocation of script directly results in Python adding a directory containing
 the symlink-dereferenced path to the script into the path.  On Debian systems
 it would result in adding /usr/share/pyshared path to the sys.path breaking
 import of many modules.

Origin: Debian
Bug-Debian: http://bugs.debian.org/620551
Last-Update: 2013-01-22

--- a/pp.py
+++ b/pp.py
@@ -127,9 +127,7 @@ class _Task(object):
 class _Worker(object):
     """Local worker class
     """
-    command = [sys.executable, "-u",
-            os.path.dirname(os.path.abspath(__file__))
-            + os.sep + "ppworker.py"]
+    command = [sys.executable, "-u", "-m" , "ppworker"]
 
     command.append("2>/dev/null")