From 8d0fc41a2efb0245b4bd64c9a1ecfc6a904a300a Mon Sep 17 00:00:00 2001
From: zooko <zooko@zooko.com>
Date: Fri, 5 Oct 2007 02:35:24 +0530
Subject: [PATCH] zfec: import latest variant of ez_setup.py

darcs-hash:6a84806a63dc64da55d82ec3626b2d65061ef059
---
 zfec/ez_setup.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/zfec/ez_setup.py b/zfec/ez_setup.py
index d7c4e5e..69a6f1e 100755
--- a/zfec/ez_setup.py
+++ b/zfec/ez_setup.py
@@ -13,7 +13,7 @@ the appropriate options to ``use_setuptools()``.
 
 This file can also be run as a script to install or upgrade setuptools.
 """
-import subprocess, sys
+import sys
 DEFAULT_VERSION = "0.6c7"
 DEFAULT_URL     = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
 
@@ -48,7 +48,11 @@ def setuptools_is_new_enough(required_version):
     """Return True if setuptools is already installed and has a version
     number >= required_version."""
     verstr = get_setuptools_version()
-    import pkg_resources
+    try:
+        import pkg_resources
+    except ImportError:
+        # Well then I guess it is definitely not new enough.
+        return False
     try:
         ver = pkg_resources.parse_version(verstr)
         newenough = ver and ver >= pkg_resources.parse_version(required_version)
@@ -202,7 +206,7 @@ def update_md5(filenames):
 
 
 if __name__=='__main__':
-    if '--md5update' in sys.argv[1]:
+    if '--md5update' in sys.argv:
         sys.argv.remove('--md5update')
         update_md5(sys.argv[1:])
     else:
-- 
2.45.2