From 2be8a41fed38f9375760d9322edcca5218db05d2 Mon Sep 17 00:00:00 2001 From: tarek Date: Wed, 22 Jul 2009 17:58:08 +0200 Subject: fixed import test --HG-- branch : distribute extra : rebase_source : a007e84b35812190d3cb622d372b48c96634fc08 --- tests/install_test.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests/install_test.py') diff --git a/tests/install_test.py b/tests/install_test.py index 24490a3c..11fc2cb6 100644 --- a/tests/install_test.py +++ b/tests/install_test.py @@ -23,8 +23,22 @@ else: os.spawnv(os.P_WAIT, sys.executable, args) # now checking if Distribute is installed +script = """\ +import sys +try: + import setuptools +except ImportError: + sys.exit(0) + +sys.exit(hasattr(setuptools, "_distribute")) +""" + +f = open('script.py', 'w') +f.write(script) +f.close() + +args = [sys.executable] + ['script.py'] -args = [sys.executable] + ['-c', 'import setuptools; import sys; sys.exit(hasattr(setuptools, "_distribute"))'] if is_jython: res = subprocess.call([sys.executable] + args) else: -- cgit v1.2.3