New ctypes error-handling protocol (Simplifying code here and there...)
Written by
on
in
Snaking.
Thomas added a spiffy new protocol to ctypes to allow for registering error-checking functions for a ctypes cFunction. It's a pretty simple protocol, just assign to the errcheck attribute of the cFunction a function with a signature like so:
def glCheckError(
result,
function,
cArguments,
*args
):
"""Return final result or raise error"""
return result
With that it's possible to get rid of one of the OpenGL-ctypes wrapper classes, and simplify the other one so that it assumes that the error-checking will occur at the ctypes level and catches errors as they occur to annotate them with more information about the calling context.
Anyway, just about time I head to bed. Visiting grams a day earlier than normal (just for a change).
Pingbacks
Pingbacks are closed.
Comments
Comments are closed.