Commits

Ronald Oussoren committed 110cc72

Print an error when ez_setup won't be capable of installing setuptools for
you.

Comments (0)

Files changed (1)

 #!/usr/bin/env python
 
 import ez_setup
+import sys
+
+# ez_setup doesn't suppport the trunk of python (as well as ancient versions
+# of python), check if a setuptools egg is listed for the current python version
+# before going futher.
+
+# We need at least Python 2.3
+MIN_PYTHON = (2, 3)
+
+if sys.version_info < MIN_PYTHON:
+    vstr = '.'.join(map(str, MIN_PYTHON))
+    raise SystemExit('PyObjC: Need at least Python ' + vstr)
+
+v = "py%d.%d.egg"%(sys.version_info[:2])
+for k in ez_setup.md5_data.keys():
+    if k.endswith(v):
+        break
+
+else:
+    try:
+        import setuptools
+    except ImportError:
+        print "Ez_setup doesn't seem to support this version of python"
+        print "Please install setuptools from source by hand. See "
+        print "http://peak.telecommunity.com/DevCenter/setuptools for "
+        print "more information on setuptools."
+        sys.exit(1)
+
+
 ez_setup.use_setuptools()
 
 import sys
 # NOTE: This is an experimental feature.
 AUTO_UNIVERSAL=0
 
-# We need at least Python 2.3
-MIN_PYTHON = (2, 3)
-
-if sys.version_info < MIN_PYTHON:
-    vstr = '.'.join(map(str, MIN_PYTHON))
-    raise SystemExit('PyObjC: Need at least Python ' + vstr)
 
 # Add our dependencies to the path.
 site.addsitedir(os.path.abspath('source-deps'))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.