diff options
author | PJ Eby <distutils-sig@python.org> | 2006-02-14 19:07:56 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2006-02-14 19:07:56 +0000 |
commit | 71aeed6af15f476a6af8b6ac10628d11fcf18358 (patch) | |
tree | 263577c68aa5e76db760cc4bb76f0fa37b8d366e /setuptools | |
parent | 38aa9be2b1edfa477277d4c1494642061cf43a0f (diff) | |
download | external_python_setuptools-71aeed6af15f476a6af8b6ac10628d11fcf18358.tar.gz external_python_setuptools-71aeed6af15f476a6af8b6ac10628d11fcf18358.tar.bz2 external_python_setuptools-71aeed6af15f476a6af8b6ac10628d11fcf18358.zip |
Fix a Windows problem when the Python executable is in a directory with
a ' ' in its name.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4042359
Diffstat (limited to 'setuptools')
-rwxr-xr-x | setuptools/command/easy_install.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 34d362ab..406e48ae 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -286,7 +286,7 @@ class easy_install(Command): def cant_write_to_target(self): - msg = """can't create or remove files in install directory + msg = """can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: @@ -316,7 +316,7 @@ variable. For information on other options, you may wish to consult the documentation at: - + http://peak.telecommunity.com/EasyInstall.html Please make the appropriate changes for your system and try again. @@ -341,15 +341,15 @@ Please make the appropriate changes for your system and try again. else: try: f.write("import os;open(%r,'w').write('OK')\n" % (ok_file,)) - f.close(); f=None + f.close(); f=None executable = sys.executable - if os.name=='nt': + if os.name=='nt': dirname,basename = os.path.split(executable) alt = os.path.join(dirname,'pythonw.exe') if basename.lower()=='python.exe' and os.path.exists(alt): - # use pythonw.exe to avoid opening a console window + # use pythonw.exe to avoid opening a console window executable = alt - + if ' ' in executable: executable='"%s"' % executable from distutils.spawn import spawn spawn([executable,'-E','-c','pass'],0) @@ -361,9 +361,9 @@ Please make the appropriate changes for your system and try again. return True finally: if f: f.close() - if os.path.exists(ok_file): os.unlink(ok_file) + if os.path.exists(ok_file): os.unlink(ok_file) if os.path.exists(pth_file): os.unlink(pth_file) - + log.warn("TEST FAILED: %s does NOT support .pth files", instdir) return False @@ -1483,7 +1483,7 @@ def main(argv=None, **kw): usage: %(script)s [options] requirement_or_url ... or: %(script)s --help """ - + def gen_usage (script_name): script = os.path.basename(script_name) return USAGE % vars() @@ -1495,7 +1495,7 @@ usage: %(script)s [options] requirement_or_url ... return f() finally: distutils.core.gen_usage = old_gen_usage - + class DistributionWithoutHelpCommands(Distribution): def _show_help(self,*args,**kw): with_ei_usage(lambda: Distribution._show_help(self,*args,**kw)) @@ -1505,7 +1505,7 @@ usage: %(script)s [options] requirement_or_url ... with_ei_usage(lambda: setup( - script_args = ['-q','easy_install', '-v']+argv, + script_args = ['-q','easy_install', '-v']+argv, distclass=DistributionWithoutHelpCommands, **kw ) ) |