From 8fb23414720e8d29f70a3746b48f02d8eb03eaa2 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 19 Dec 2009 19:49:13 +0000 Subject: [PATCH] When spawning a download subprocess, add zeroinstall to sys.path Otherwise, it will try to use the system version (or fail if there isn't one). Repored by Lennon Cook. --- tests/testdownload.py | 1 - zeroinstall/injector/download.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/testdownload.py b/tests/testdownload.py index d7af08b..012819a 100755 --- a/tests/testdownload.py +++ b/tests/testdownload.py @@ -8,7 +8,6 @@ from logging import getLogger, WARN, ERROR from contextlib import contextmanager sys.path.insert(0, '..') -os.environ['PYTHONPATH'] = os.path.abspath('..') os.environ["http_proxy"] = "localhost:8000" diff --git a/zeroinstall/injector/download.py b/zeroinstall/injector/download.py index 3f300c6..b4e9fc0 100644 --- a/zeroinstall/injector/download.py +++ b/zeroinstall/injector/download.py @@ -10,6 +10,10 @@ This is the low-level interface for downloading interfaces, implementations, ico # See the README file for details, or visit http://0install.net. import tempfile, os, sys, subprocess + +if __name__ == '__main__': + sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) + from zeroinstall import SafeException from zeroinstall.support import tasks from logging import info, debug -- 2.11.4.GIT