You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I compile a python file test.py to a shared library by Cython, then use python to import this shared library for testing.The original python file raise ZeroDivisionError but this shared library doesn't.The following is the whole code to reproduce this issue
test.py:
try:
print("try")
l = [0.0]
ll = [1.0/x for x in l]
print("try end")
except ZeroDivisionError:
print("exception")
Original python output:
try
exception
Shared library by Cython output:
try
try end
python version: 3.6
cython version: 0.29.3
The text was updated successfully, but these errors were encountered:
Thanks for the quick response!! Maybe I should revise the title...
Please also let me know if there is any existed setting or option could workaround it
scoder
changed the title
Can't catch ZeroDivisionError exception
Division by 0 does not raise ZeroDivisionError
Feb 1, 2019
I compile a python file test.py to a shared library by Cython, then use python to import this shared library for testing.The original python file raise ZeroDivisionError but this shared library doesn't.The following is the whole code to reproduce this issue
test.py:
Original python output:
try
exception
Shared library by Cython output:
try
try end
python version: 3.6
cython version: 0.29.3
The text was updated successfully, but these errors were encountered: