diff options
| author | tarek <devnull@localhost> | 2009-12-30 08:37:38 +0100 |
|---|---|---|
| committer | tarek <devnull@localhost> | 2009-12-30 08:37:38 +0100 |
| commit | fc770b69a779ee621b4b619eccb431a60afbd76f (patch) | |
| tree | af79156f2b254b731a1b6595946a8d86718fed95 /tests/manual_test.py | |
| parent | 4f03234aff8efb6e55db5094463794c939b68b97 (diff) | |
| download | python-setuptools-bitbucket-fc770b69a779ee621b4b619eccb431a60afbd76f.tar.gz | |
make sure manual_test can be used under 2.3
Diffstat (limited to 'tests/manual_test.py')
| -rw-r--r-- | tests/manual_test.py | 20 |
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(): |
