aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortarek <none@none>2009-12-30 08:37:38 +0100
committertarek <none@none>2009-12-30 08:37:38 +0100
commit58aef4573a45d88e82348d8e2978311de3bdd5ae (patch)
tree9f925cc7fe83679df1fe94c333ba3c8bccd49ca4
parentb957465761ed97329b3ca94c9814ca37355b20db (diff)
downloadexternal_python_setuptools-58aef4573a45d88e82348d8e2978311de3bdd5ae.tar.gz
external_python_setuptools-58aef4573a45d88e82348d8e2978311de3bdd5ae.tar.bz2
external_python_setuptools-58aef4573a45d88e82348d8e2978311de3bdd5ae.zip
make sure manual_test can be used under 2.3
--HG-- branch : distribute extra : rebase_source : 0186c52fe9d753201828f54f5e6b348829eb4821
-rw-r--r--tests/manual_test.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/manual_test.py b/tests/manual_test.py
index 63464bc5..0d5051f1 100644
--- a/tests/manual_test.py
+++ b/tests/manual_test.py
@@ -7,11 +7,25 @@ if sys.version_info[0] >= 3:
import os
import shutil
import tempfile
-import subprocess
from distutils.command.install import INSTALL_SCHEMES
from string import Template
from urllib2 import urlopen
-import subprocess
+
+try:
+ import subprocess
+ def _system_call(*args):
+ assert subprocess.call(args) == 0
+except ImportError:
+ # Python 2.3
+ def _system_call(*args):
+ # quoting arguments if windows
+ if sys.platform == 'win32':
+ def quote(arg):
+ if ' ' in arg:
+ return '"%s"' % arg
+ return arg
+ args = [quote(arg) for arg in args]
+ assert os.system(' '.join(args)) == 0
def tempdir(func):
def _tempdir(*args, **kwargs):
@@ -49,8 +63,6 @@ if sys.platform == 'win32':
else:
PURELIB = INSTALL_SCHEMES['unix_prefix']['purelib']
-def _system_call(*args):
- assert subprocess.call(args) == 0
@tempdir
def test_virtualenv():