PEP-654: warn that leaf_generator recycles the tracebacks list (GH-2109)
This commit is contained in:
parent
42c420f24f
commit
27b8357bac
|
@ -469,7 +469,12 @@ recursively, as follows:
|
|||
else:
|
||||
# exc is a leaf exception and its traceback
|
||||
# is the concatenation of the traceback
|
||||
# segments in tbs
|
||||
# segments in tbs.
|
||||
|
||||
# Note: the list returned (tbs) is reused in each iteration
|
||||
# through the generator. Make a copy if your use case holds
|
||||
# on to it beyond the current iteration or mutates its contents.
|
||||
|
||||
yield exc, tbs
|
||||
tbs.pop()
|
||||
|
||||
|
|
Loading…
Reference in New Issue