In my real case a Segmentation fault
arises in the finally
clause which I can't do anything about because it stems from an external library used via ctypes. Actually, I don't care about this segfault because the script is done anyway.
However, the segfault in the finally eats all Exceptions occuring prior to it. Thus, debugging that first NameError
from iDontExist
becomes a pain in the ass. It doesn't occur anywhere. Currently there is no way of seeing any raised Exceptions from before the segfault.
def f1():
try:
while True:
pass
except KeyboardInterrupt:
print iDontExist
if __name__=="__main__":
try:
f1()
finally:
raise Exception("segfault here")
print "finally"
What do you think I could do about it? Fixing the external library is not an option.