[issue25782] CPython hangs on error __context__ set to the error itself

Nikita Sobolev report at bugs.python.org
Mon Aug 9 13:20:54 EDT 2021


Nikita Sobolev <mail at sobolevn.me> added the comment:

There's also a similar case with python3.9:

```python
>>> class MyError(Exception):
...   ...
... 
>>> e = MyError('e')
>>> e.__context__ = e
>>> 
>>> try:
...   raise e
... except MyError:
...   print('done')
... 
done  # hangs after this
^C^Z
```

The same code works with python3.8
We got hit by this in RustPython: https://github.com/RustPython/RustPython/pull/2820

----------
nosy: +sobolevn

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25782>
_______________________________________


More information about the Python-bugs-list mailing list