Skip to content

Commit

Permalink
check __exception_formatter__ also in extractStack
Browse files Browse the repository at this point in the history
  • Loading branch information
agroszer committed Aug 12, 2015
1 parent 70384f9 commit 11cbc27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/zope/exceptions/exceptionformatter.py
Expand Up @@ -205,6 +205,14 @@ def extractStack(self, f=None):
__exception_formatter__ = 1
result = []
while f is not None:
if f.f_locals.get('__exception_formatter__'):
# Stop recursion.
result.append('(Recursive extractStack() stopped, '
'trying traceback.format_stack)\n')
res = traceback.format_stack(f)
res.reverse()
result.extend(res)
break
line = self.formatLine(f=f)
result.append(line + '\n')
f = f.f_back
Expand Down

0 comments on commit 11cbc27

Please sign in to comment.