]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/commitdiff
setup: show-tool-versions: emit module and __version__ information even when module...
authorzooko <zooko@zooko.com>
Sat, 30 Oct 2010 06:59:13 +0000 (12:29 +0530)
committerzooko <zooko@zooko.com>
Sat, 30 Oct 2010 06:59:13 +0000 (12:29 +0530)
Ignore-this: 93c1d7e5062a85a27d5b3df91d13d86f

darcs-hash:22685813d4d1ca719250b2842ba6a72a26ae479e

misc/build_helpers/show-tool-versions.py

index b8f77478f2d39103c265dafab1bec0628a35051f..d3b3153f934386a53998f85b8ca8e453592fed20 100755 (executable)
@@ -66,7 +66,10 @@ def print_setuptools_ver():
         sys.stderr.flush()
         pass
 
-def print_py_pkg_ver(pkgname):
+def print_py_pkg_ver(pkgname, modulename=None):
+    if modulename is None:
+        modulename = pkgname
+
     print
     try:
         import pkg_resources
@@ -83,11 +86,11 @@ def print_py_pkg_ver(pkgname):
         sys.stderr.flush()
         pass
     try:
-        __import__(pkgname)
+        __import__(modulename)
     except ImportError:
         pass
     else:
-        modobj = sys.modules.get(pkgname)
+        modobj = sys.modules.get(modulename)
         print pkgname + ' module: ' + str(modobj)
         try:
             print pkgname + ' __version__: ' + str(modobj.__version__)
@@ -113,5 +116,5 @@ print_py_pkg_ver('trialcoverage')
 print_py_pkg_ver('setuptools_trial')
 print_py_pkg_ver('setuptools_darcs')
 print_py_pkg_ver('darcsver')
-print_py_pkg_ver('twisted')
-print_py_pkg_ver('TwistedCore')
+print_py_pkg_ver('Twisted', 'twisted')
+print_py_pkg_ver('TwistedCore', 'twisted.python')