mwparserfromhell
mwparserfromhell copied to clipboard
C tokenizer: use goto for error handling
The Python C API docs recommend goto
(gasp) for error handling in C functions, where there's a block at the end of each function that calls Py_XDECREF()
on every Python object used in that function and then returns a pre-set value (0 or 1 depending on success or failure). This is better than our current system of a bunch of Py_DECREF()
calls every time a function raises an error.