| 18 | /* #define ACQUIRE_GIL */ |
| 19 | |
| 20 | static void |
| 21 | set_overflow(void) { |
| 22 | #ifdef ACQUIRE_GIL |
| 23 | /* Need to grab the GIL to dodge a bug in numpy */ |
| 24 | PyGILState_STATE state = PyGILState_Ensure(); |
| 25 | #endif |
| 26 | if (!PyErr_Occurred()) { |
| 27 | PyErr_SetString(PyExc_OverflowError, |
| 28 | "overflow in rational arithmetic"); |
| 29 | } |
| 30 | #ifdef ACQUIRE_GIL |
| 31 | PyGILState_Release(state); |
| 32 | #endif |
| 33 | } |
| 34 | |
| 35 | static void |
| 36 | set_zero_divide(void) { |
no outgoing calls
no test coverage detected