diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-16 23:02:32 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-16 23:02:32 (GMT) |
commit | 9d620d018c64affba26debf4397cb86c6767714e (patch) | |
tree | e7070f68ca2a98d0dcbb9e285c23287752b7951a /Include/token.h | |
parent | 61acf067ac7820d5e5a02c17d3d55f7f19a8e52e (diff) | |
download | cpython-9d620d018c64affba26debf4397cb86c6767714e.zip cpython-9d620d018c64affba26debf4397cb86c6767714e.tar.gz cpython-9d620d018c64affba26debf4397cb86c6767714e.tar.bz2 |
Simplify and fix error handling for most cases.
Many functions used a local variable called return_error, which was
initialized to zero. If an error occurred, it was set to true. Most
of the code paths checked were only executed if return_error was
false. goto is clearer.
The code also seemed to be written under the curious assumption that
calling Py_DECREF() on a local variable would assign the variable to
NULL. As a result, more of the error-exit code paths returned an
object that had a reference count of zero instead of just returning
NULL. Fixed the code to explicitly assign NULL after the DECREF.
A bit more reformatting, but not much.
XXX Need a much better test suite for zlib, since it the current tests
don't exercise any of this broken code.
Diffstat (limited to 'Include/token.h')
0 files changed, 0 insertions, 0 deletions