From 4aeff437f48eef795a3cdcce1e76e710466e5c37 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 10 Oct 2012 19:11:06 +0200 Subject: [PATCH] Show full exception traceback if pip import failes but pip exists (PY-7782). --- python/helpers/packaging_tool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/helpers/packaging_tool.py b/python/helpers/packaging_tool.py index 420d106c6a55..5ddfcc8317b7 100644 --- a/python/helpers/packaging_tool.py +++ b/python/helpers/packaging_tool.py @@ -31,7 +31,11 @@ def error(message, retcode): def error_no_pip(): - error("Python package management tool 'pip' not found", ERROR_NO_PIP) + tb = sys.exc_traceback + if tb is not None and tb.tb_next is None: + error("Python package management tool 'pip' not found", ERROR_NO_PIP) + else: + error(traceback.format_exc(), ERROR_EXCEPTION) def do_list():