cli: Fix traceback detection
This commit is contained in:
parent
a754718889
commit
12a7a18be0
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue