Message386569
At the REPL, when sys.excepthook is broken (below by setting it to a non-callable), one sees:
```
⊙ python3.9 julian@Airm
Python 3.9.1 (default, Feb 2 2021, 22:54:59)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; sys.excepthook = object(); asdf
Error in sys.excepthook:
TypeError: 'object' object is not callable
Original exception was:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'asdf' is not defined
```
The implementation (https://github.com/python/cpython/blob/5f18c223391eef8c7d01241b51a7b2429609dd84/Python/pythonrun.c#L805-L817) seems to do so by reimplementing something like 3.8+'s sys.unraisablehook (well, technically it predates sys.unraisablehook by quite a while).
Seems like now that it exists, that code should now call sys.unraisablehook. |
|
Date |
User |
Action |
Args |
2021-02-06 20:55:56 | Julian | set | recipients:
+ Julian, vstinner |
2021-02-06 20:55:56 | Julian | set | messageid: <1612644956.56.0.525565389562.issue43148@roundup.psfhosted.org> |
2021-02-06 20:55:56 | Julian | link | issue43148 messages |
2021-02-06 20:55:56 | Julian | create | |
|