def check_error(status):
global ERROR_MSG_LST<EOL>if status != <NUM_LIT:1>:<EOL><INDENT>if len(ERROR_MSG_LST) > <NUM_LIT:0>:<EOL><INDENT>msg = '<STR_LIT:\n>'.join(ERROR_MSG_LST)<EOL>ERROR_MSG_LST = []<EOL>raise OpenJPEGLibraryError(msg)<EOL><DEDENT>else:<EOL><INDENT>raise OpenJPEGLibraryError("<STR_LIT>")<EOL><DEDENT><DEDENT>
Set a generic function as the restype attribute of all OpenJPEG
    functions that return a BOOL_TYPE value.  This way we do not have to check
    for error status in each wrapping function and an exception will always be
    appropriately raised.