mwparserfromhell icon indicating copy to clipboard operation
mwparserfromhell copied to clipboard

C tokenizer: use goto for error handling

Open earwig opened this issue 10 years ago • 0 comments

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.

earwig avatar Aug 15 '13 06:08 earwig