App GTK2 on Linux Deb64.
It is indeed strange that the Try..Except block does not handle division by zero errors. Perhaps using an If..Else statement would be a workaround.
For GTK and Qt the Divide-By-Zero exception is explicitely disabled, because the C (for GTK) and C++ (for Qt) code doesn't handle it either and thus doesn't expect enabled Divide-By-Zero exceptions. These exception masks are per thread.
That probably explains a "funny" I saw a few days ago. I was generating a demo waveform (sinc() function) for a digital scope program in a .so, and had a divide-by-zero which was putting a NaN in one position. Somewhat later I applied an FFT and had an NaN in /every/ position... much headscratching ensued.
MarkMLl