[Python-checkins] python/nondist/sandbox/setuptools ez_setup.py, 1.9, 1.10

pje@users.sourceforge.net pje at users.sourceforge.net
Thu Jul 7 03:52:23 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8100

Modified Files:
	ez_setup.py 
Log Message:
Backward-compatibility fix, so ez_setup can upgrade older versions of
setuptools.


Index: ez_setup.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/ez_setup.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ez_setup.py	6 Jul 2005 03:47:04 -0000	1.9
+++ ez_setup.py	7 Jul 2005 01:52:21 -0000	1.10
@@ -66,7 +66,7 @@
         egg = download_setuptools(version, download_base, to_dir)
         sys.path.insert(0, egg)
         import setuptools; setuptools.bootstrap_install_from = egg
-        
+
     import pkg_resources
     try:
         pkg_resources.require("setuptools>="+version)
@@ -102,7 +102,7 @@
             src = urllib2.urlopen(url)
             # Read/write all in one block, so we don't create a corrupt file
             # if the download is interrupted.
-            data = src.read()           
+            data = src.read()
             dst = open(saveto,"wb")
             dst.write(data)
         finally:
@@ -146,7 +146,10 @@
     try:
         pkg_resources.require(req)
     except pkg_resources.VersionConflict:
-        from setuptools.command.easy_install import main
+        try:
+            from setuptools.command.easy_install import main
+        except ImportError:
+            from easy_install import main
         main(list(argv)+[req])
         sys.exit(0) # try to force an exit
     else:
@@ -159,6 +162,3 @@
 if __name__=='__main__':
     main(sys.argv[1:])
 
-
-
-



More information about the Python-checkins mailing list