From: Brian Warner <warner@allmydata.com>
Date: Sat, 5 Jan 2008 03:53:41 +0000 (-0700)
Subject: remove runtime dependency upon setuptools (which crept into allmydata.get_package_ver... 
X-Git-Tag: allmydata-tahoe-0.7.0~27
X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/banana.xhtml?a=commitdiff_plain;h=1dd655c59eba4d671d52766ac58ba4ef7c128ae2;p=tahoe-lafs%2Ftahoe-lafs.git

remove runtime dependency upon setuptools (which crept into allmydata.get_package_versions)
---

diff --git a/src/allmydata/__init__.py b/src/allmydata/__init__.py
index 0abcdd3b..ba3f840a 100644
--- a/src/allmydata/__init__.py
+++ b/src/allmydata/__init__.py
@@ -20,14 +20,20 @@ hush_pyflakes = __version__
 del hush_pyflakes
 
 def get_package_versions():
-    import OpenSSL, allmydata, foolscap, nevow, pycryptopp, setuptools, simplejson, twisted, zfec
+    import OpenSSL, allmydata, foolscap, nevow, pycryptopp, simplejson, twisted, zfec
+    setuptools_version = "unavailable"
+    try:
+        import setuptools
+        setuptools_version = setuptools.__version__
+    except ImportError:
+        pass
     return {
         'pyopenssl': OpenSSL.__version__,
         'allmydata': allmydata.__version__,
         'foolscap': foolscap.__version__,
         'nevow': nevow.__version__,
         'pycryptopp': pycryptopp.__version__,
-        'setuptools': setuptools.__version__,
+        'setuptools': setuptools_version,
         'simplejson': simplejson.__version__,
         'twisted': twisted.__version__,
         'zfec': zfec.__version__,