From 1ea1dd08165697516a2ee32cca702237c48a7fe3 Mon Sep 17 00:00:00 2001
From: zooko <zooko@zooko.com>
Date: Sat, 30 Oct 2010 12:29:13 +0530
Subject: [PATCH] setup: show-tool-versions: emit module and __version__
 information even when module name != distribution (package) name, and add
 TwistedCore

Ignore-this: 93c1d7e5062a85a27d5b3df91d13d86f

darcs-hash:22685813d4d1ca719250b2842ba6a72a26ae479e
---
 misc/build_helpers/show-tool-versions.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/misc/build_helpers/show-tool-versions.py b/misc/build_helpers/show-tool-versions.py
index b8f7747..d3b3153 100755
--- a/misc/build_helpers/show-tool-versions.py
+++ b/misc/build_helpers/show-tool-versions.py
@@ -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')
-- 
2.45.2