diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2004-03-25 15:36:21 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2004-03-25 15:36:21 +0000 |
commit | 7bf0e17070f0a95f1e8f5d86716a5a62cd6bc31c (patch) | |
tree | 2e7620e92be1555e1bcf57cc6c433ce8bf75f8c0 /scipy_distutils/exec_command.py | |
parent | 112824ccfdfab97d98f7939b2d31119d6acb4240 (diff) | |
download | numpy-7bf0e17070f0a95f1e8f5d86716a5a62cd6bc31c.tar.gz |
Fixed duplicate quotation of a command path.
Diffstat (limited to 'scipy_distutils/exec_command.py')
-rw-r--r-- | scipy_distutils/exec_command.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scipy_distutils/exec_command.py b/scipy_distutils/exec_command.py index 8a3e2e6db..72ffdc5e3 100644 --- a/scipy_distutils/exec_command.py +++ b/scipy_distutils/exec_command.py @@ -329,6 +329,10 @@ def _exec_command_python(command, return status, text +def quote_arg(arg): + if arg[0]!='"' and ' ' in arg: + return '"%s"' % arg + return arg def _exec_command( command, use_shell=None, **env ): log.debug('_exec_command(...)') @@ -390,9 +394,7 @@ def _exec_command( command, use_shell=None, **env ): else: os.dup2(fout.fileno(),se_fileno) - argv0 = argv[0] - if ' ' in argv[0]: - argv[0] = '"%s"' % (argv[0]) + argv0 = quote_arg(argv[0]) try: status = spawn_command(os.P_WAIT,argv0,argv,os.environ) |