aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/log.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpkid/rpki/log.py')
-rw-r--r--rpkid/rpki/log.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/rpkid/rpki/log.py b/rpkid/rpki/log.py
index 50f0839d..d3eb41cd 100644
--- a/rpkid/rpki/log.py
+++ b/rpkid/rpki/log.py
@@ -102,9 +102,9 @@ def traceback():
Consolidated backtrace facility with a bit of extra info.
"""
+ assert sys.exc_info() != (None, None, None), "rpki.log.traceback() called without valid trace on stack, this is a programming error"
bt = tb.extract_stack(limit = 3)
error("Exception caught in %s() at %s:%d called from %s:%d" % (bt[1][2], bt[1][0], bt[1][1], bt[0][0], bt[0][1]))
- if sys.exc_info() == (None, None, None):
- error("Stacktrace (most recent call last):\n" + "".join(tb.format_stack()))
- else:
- error(tb.format_exc())
+ bt = tb.format_exc()
+ assert bt is not None, "Apparently I'm still not using the right test for null backtrace"
+ error(bt)