| 33 | } |
| 34 | |
| 35 | static void |
| 36 | set_zero_divide(void) { |
| 37 | #ifdef ACQUIRE_GIL |
| 38 | /* Need to grab the GIL to dodge a bug in numpy */ |
| 39 | PyGILState_STATE state = PyGILState_Ensure(); |
| 40 | #endif |
| 41 | if (!PyErr_Occurred()) { |
| 42 | PyErr_SetString(PyExc_ZeroDivisionError, |
| 43 | "zero divide in rational arithmetic"); |
| 44 | } |
| 45 | #ifdef ACQUIRE_GIL |
| 46 | PyGILState_Release(state); |
| 47 | #endif |
| 48 | } |
| 49 | |
| 50 | /* Integer arithmetic utilities */ |
| 51 |
no outgoing calls
no test coverage detected