cli: Fix traceback detection

This commit is contained in:
Cole Robinson 2018-09-06 18:37:18 -04:00
parent a754718889
commit 12a7a18be0
2 changed files with 4 additions and 4 deletions

View File

@ -4,6 +4,7 @@
# See the COPYING file in the top-level directory.
import logging
import sys
import traceback
from gi.repository import Gtk
@ -67,9 +68,8 @@ class vmmErrorDialog(vmmGObject):
if details is None:
details = summary
tb = "".join(traceback.format_exc()).strip()
if tb != "None":
details += "\n\n" + tb
if sys.exc_info()[0] is not None:
details += "\n\n" + "".join(traceback.format_exc()).strip()
else:
details = str(details)

View File

@ -276,7 +276,7 @@ def fail(msg, do_exit=True):
"""
logging.debug("".join(traceback.format_stack()))
logging.error(msg)
if traceback.format_exc().strip() != "None":
if sys.exc_info()[0] is not None:
logging.debug("", exc_info=True)
if do_exit:
_fail_exit()