Message369483
Just a note, __context__ cycles can theoretically be longer than 2 nodes. I've encountered cycles like `exc.__context__.__context__.__context__ is exc` a few times in my life, typically resulting from some weird third-party libraries.
The only solution is to use a `set()` collection to track already visited exceptions.
To make it fast I propose to modify the code to:
1. Do a fast traverse with a regular while loop without tracking (no set())
2. If the number of iterations is longer than 100 and there's still no top context found -- go to (3)
3. Do a slower implementation with set() |
|
Date |
User |
Action |
Args |
2020-05-21 00:11:30 | yselivanov | set | recipients:
+ yselivanov, asvetlov, chris.jerdonek, eamanu, BTaskaya, aeros, carltongibson, felixxm |
2020-05-21 00:11:30 | yselivanov | set | messageid: <1590019890.19.0.731143371768.issue40696@roundup.psfhosted.org> |
2020-05-21 00:11:30 | yselivanov | link | issue40696 messages |
2020-05-21 00:11:29 | yselivanov | create | |
|