Commit 58aef457 authored by tarek's avatar tarek

make sure manual_test can be used under 2.3

--HG--
branch : distribute
extra : rebase_source : 0186c52fe9d753201828f54f5e6b348829eb4821
parent b9574657
...@@ -7,11 +7,25 @@ if sys.version_info[0] >= 3: ...@@ -7,11 +7,25 @@ if sys.version_info[0] >= 3:
import os import os
import shutil import shutil
import tempfile import tempfile
import subprocess
from distutils.command.install import INSTALL_SCHEMES from distutils.command.install import INSTALL_SCHEMES
from string import Template from string import Template
from urllib2 import urlopen 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(func):
def _tempdir(*args, **kwargs): def _tempdir(*args, **kwargs):
...@@ -49,8 +63,6 @@ if sys.platform == 'win32': ...@@ -49,8 +63,6 @@ if sys.platform == 'win32':
else: else:
PURELIB = INSTALL_SCHEMES['unix_prefix']['purelib'] PURELIB = INSTALL_SCHEMES['unix_prefix']['purelib']
def _system_call(*args):
assert subprocess.call(args) == 0
@tempdir @tempdir
def test_virtualenv(): def test_virtualenv():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment