def check_geom(result, func, cargs):
    "Checks a function that returns a geometry."
    # OGR_G_Clone may return an integer, even though the
    # restype is set to c_void_p
    if isinstance(result, six.integer_types):
        result = c_void_p(result)
    if not result:
        raise GDALException(func.__name__ % 'Invalid geometry pointer returned from "%s".')
    return result
dataset/ETHPy150Open django/django/django/contrib/gis/gdal/prototypes/errcheck.py/check_geom/swapped operands of `%`