We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a2bb0a commit f62a220Copy full SHA for f62a220
mypyc/codegen/emitclass.py
@@ -851,7 +851,9 @@ def generate_dealloc_for_class(
851
# CPython interpreter prints: Exception ignored in: <function F.__del__ at 0x100aed940>
852
# mypyc prints: Exception ignored in: <slot wrapper '__del__' of 'F' objects>
853
emitter.emit_line("if (PyErr_Occurred() != NULL) {")
854
+ # Don't untrack instance if error occurred
855
emitter.emit_line("PyErr_WriteUnraisable((PyObject *)self);")
856
+ emitter.emit_line("res = -1;")
857
emitter.emit_line("}")
858
emitter.emit_line("PyErr_Restore(type, value, traceback);")
859
emitter.emit_line("if (res < 0) {")
0 commit comments