diff options
author | David Lehman <dlehman@redhat.com> | 2008-12-08 11:17:26 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2008-12-08 12:03:19 -0600 |
commit | 64b793a0136323ea2bb8e1d58628d454cd59724c (patch) | |
tree | ca65d7d92899e9b1ea0498baee8b3f5ab5c3e18b /partedUtils.py | |
parent | bc9469f6d06ecc6bde6129dbcf2f4ae35bb874da (diff) | |
download | anaconda-64b793a0136323ea2bb8e1d58628d454cd59724c.tar.gz anaconda-64b793a0136323ea2bb8e1d58628d454cd59724c.tar.xz anaconda-64b793a0136323ea2bb8e1d58628d454cd59724c.zip |
Use stacks instead of tracebacks in traceback handlers.
This allows us to generate traceback-like stacks on demand
using inspect.stack(). stack() returns a list of tuples
representing the stack frames at the time of invocation. A
traceback object can be converted to a list of these
tuples by calling inspect.getinnerframes(tb). NOTE: the
stack() function returns the frames in the opposite order
of a traceback's.
Diffstat (limited to 'partedUtils.py')
-rw-r--r-- | partedUtils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/partedUtils.py b/partedUtils.py index fac1433b9..ea6f4a0f4 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -37,7 +37,7 @@ import raid import dmraid import block import lvm -import traceback +import inspect from flags import flags from errors import * from constants import * @@ -1142,7 +1142,8 @@ class DiskSet: raise except: (type, value, tb) = sys.exc_info() - exn = exception.AnacondaExceptionDump(type, value, tb) + stack = inspect.getinnerframes(tb) + exn = exception.AnacondaExceptionDump(type, value, stack) lines = exn.__str__() for line in lines: log.error(line) |