Call PyErr_NormalizeException for exceptions by slide · Pull Request #1265 · pythonnet/pythonnet
I ran the same code on C Python 3.7.7 interpreter and got this, so the behavior matches:
Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class TestException(NameError):
... def __init__(self, val):
... super().__init__(val)
... x = int(val)
...
>>> raise TestException('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 4, in __init__
ValueError: invalid literal for int() with base 10: 'foo'