From: zooko Date: Sun, 19 Sep 2010 00:43:35 +0000 (+0530) Subject: setup: make show-tool-versions report entire verbose exception stack traces when... X-Git-Url: https://git.rkrishnan.org/vdrive/%5B/%5D%20/uri/flags/-?a=commitdiff_plain;h=d826ea55ef7b9f40fe611f086eb182058b2ec7b3;p=tahoe-lafs%2Fzfec.git setup: make show-tool-versions report entire verbose exception stack traces when it fails to find a Python package Ignore-this: 98f469a357e45fda5ad6c0519369ee3c darcs-hash:d3f7c4902d1d8d678e73a415a69c8355d47d8690 --- diff --git a/misc/build_helpers/show-tool-versions.py b/misc/build_helpers/show-tool-versions.py index ba59e5e..8631c93 100755 --- a/misc/build_helpers/show-tool-versions.py +++ b/misc/build_helpers/show-tool-versions.py @@ -8,9 +8,10 @@ def print_platform(): out = platform.platform() print print "platform:", out.replace("\n", " ") - except EnvironmentError, le: - sys.stderr.write("Got exception using 'platform': %s\n" % (le,)) - pass + except EnvironmentError: + sys.stderr.write("Got exception using 'platform'. Exception follows\n") + traceback.print_exc(file=sys.stderr) + pass def print_python_ver(): print "python:", sys.version.replace("\n", " ") + ', maxunicode: ' + str(sys.maxunicode) @@ -23,8 +24,9 @@ def print_cmd_ver(cmdlist, label=None): label = cmdlist[0] print print label + ': ' + res.replace("\n", " ") - except EnvironmentError, le: - sys.stderr.write("Got exception invoking '%s': %s\n" % (cmdlist[0], le,)) + except EnvironmentError: + sys.stderr.write("Got exception invoking '%s'. Exception follows.\n" % (cmdlist[0],)) + traceback.print_exc(file=sys.stderr) pass def print_as_ver(): @@ -38,8 +40,9 @@ def print_as_ver(): print print 'as: ' + res.replace("\n", " ") os.remove('a.out') - except EnvironmentError, le: - sys.stderr.write("Got exception invoking '%s': %s\n" % ('as', le,)) + except EnvironmentError: + sys.stderr.write("Got exception invoking '%s'. Exception follows.\n" % ('as',)) + traceback.print_exc(file=sys.stderr) pass def print_setuptools_ver(): @@ -48,8 +51,9 @@ def print_setuptools_ver(): out = str(pkg_resources.require("setuptools")) print print "setuptools:", out.replace("\n", " ") - except (ImportError, EnvironmentError), le: - sys.stderr.write("Got exception using 'pkg_resources' to get the version of setuptools: %s\n" % (le,)) + except (ImportError, EnvironmentError): + sys.stderr.write("Got exception using 'pkg_resources' to get the version of setuptools. Exception follows\n") + traceback.print_exc(file=sys.stderr) pass def print_py_pkg_ver(pkgname): @@ -58,11 +62,13 @@ def print_py_pkg_ver(pkgname): out = str(pkg_resources.require(pkgname)) print print pkgname + ': ' + out.replace("\n", " ") - except (ImportError, EnvironmentError), le: - sys.stderr.write("Got exception using 'pkg_resources' to get the version of %s: %s\n" % (pkgname, le,)) + except (ImportError, EnvironmentError): + sys.stderr.write("Got exception using 'pkg_resources' to get the version of %s. Exception follows.\n" % (pkgname,)) + traceback.print_exc(file=sys.stderr) pass - except pkg_resources.DistributionNotFound, le: - sys.stderr.write("pkg_resources reported no %s package installed: %s\n" % (pkgname, le,)) + except pkg_resources.DistributionNotFound: + sys.stderr.write("pkg_resources reported no %s package installed. Exception follows.\n" % (pkgname,)) + traceback.print_exc(file=sys.stderr) pass print_platform()