Merge pull request #3805 from asottile/cause_cycles

Fix traceback reporting for exceptions with `__cause__` cycles.
This commit is contained in:
Ronny Pfannschmidt
2018-08-16 07:16:51 +02:00
committed by GitHub
3 changed files with 49 additions and 1 deletions

View File

@@ -719,7 +719,9 @@ class FormattedExcinfo(object):
repr_chain = []
e = excinfo.value
descr = None
while e is not None:
seen = set()
while e is not None and id(e) not in seen:
seen.add(id(e))
if excinfo:
reprtraceback = self.repr_traceback(excinfo)
reprcrash = excinfo._getreprcrash()