[Checkins] SVN: zc.buildout/trunk/src/zc/buildout/easy_install.py Fixed careless bug in computation of exe file names.

Jim Fulton jim at zope.com
Wed Jun 20 14:23:54 EDT 2007


Log message for revision 76852:
  Fixed careless bug in computation of exe file names.
  
  Also rearranged some code to work with emacs python mode. :)
  

Changed:
  U   zc.buildout/trunk/src/zc/buildout/easy_install.py

-=-
Modified: zc.buildout/trunk/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/trunk/src/zc/buildout/easy_install.py	2007-06-20 18:22:25 UTC (rev 76851)
+++ zc.buildout/trunk/src/zc/buildout/easy_install.py	2007-06-20 18:23:54 UTC (rev 76852)
@@ -28,11 +28,13 @@
 import setuptools.archive_util
 import zc.buildout
 
+def realpath(path):
+    return path
+
 try:
     realpath = os.path.realpath
 except AttributeError:
-    def realpath(path):
-        return path
+    pass
 
 default_index_url = os.environ.get('buildout-testing-index-url')
 
@@ -841,6 +843,7 @@
     script = dest
     if sys.platform == 'win32':
         dest += '-script.py'
+
     contents = script_template % dict(
         python = executable,
         path = path,
@@ -853,10 +856,11 @@
 
     if sys.platform == 'win32':
         # generate exe file and give the script a magic name:
-        open(dest+'.exe', 'wb').write(
+        exe = script+'.exe'
+        open(exe, 'wb').write(
             pkg_resources.resource_string('setuptools', 'cli.exe')
             )
-        generated.append(dest+'.exe')
+        generated.append(exe)
         
     if changed:
         open(dest, 'w').write(contents)
@@ -899,10 +903,11 @@
 
     if sys.platform == 'win32':
         # generate exe file and give the script a magic name:
-        open(dest+'.exe', 'wb').write(
+        exe = script + '.exe'
+        open(exe, 'wb').write(
             pkg_resources.resource_string('setuptools', 'cli.exe')
             )
-        generated.append(dest+'.exe')
+        generated.append(exe)
 
     if changed:
         open(dest, 'w').write(contents)



More information about the Checkins mailing list