From 1dd655c59eba4d671d52766ac58ba4ef7c128ae2 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 4 Jan 2008 20:53:41 -0700 Subject: [PATCH] remove runtime dependency upon setuptools (which crept into allmydata.get_package_versions) --- src/allmydata/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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__, -- 2.45.2