Skip to content

Commit ca24b1d

Browse files
thomasvsylatuya
authored andcommittedDec 21, 2010
* log.py:
Handle the case where there is no useful stack to deal with.
1 parent 6316819 commit ca24b1d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
 

‎ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2010-04-16 Thomas Vander Stichele <thomas at apestaart dot org>
2+
3+
* log.py:
4+
Handle the case where there is no useful stack to deal with.
5+
16
2009-06-23 Thomas Vander Stichele <thomas at apestaart dot org>
27

38
* log.py:

‎log.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,13 @@ def getExceptionMessage(exception, frame=-1, filename=None):
636636
stack = traceback.extract_tb(sys.exc_info()[2])
637637
if filename:
638638
stack = [f for f in stack if f[0].find(filename) > -1]
639-
#import code; code.interact(local=locals())
640-
(filename, line, func, text) = stack[frame]
639+
640+
# badly raised exceptions can come without a stack
641+
if stack:
642+
(filename, line, func, text) = stack[frame]
643+
else:
644+
(filename, line, func, text) = ('no stack', 0, 'none', '')
645+
641646
filename = scrubFilename(filename)
642647
exc = exception.__class__.__name__
643648
msg = ""

0 commit comments

Comments
 (0)
Please sign in to comment.