def check_sized_string(result, func, cargs):
 if (not result):
  raise GEOSException(('Invalid string pointer returned by GEOS C function "%s"' % func.__name__))
 s = string_at(result, last_arg_byref(cargs))
 free(result)
 return s

def check_sized_string ( result , func , cargs ) : if ( not result ) : raise GEOSException ( ( 'Invalid string pointer returned by GEOS C function "%s"' % func . __name__ ) ) s = string_at ( result , last_arg_byref ( cargs ) ) free ( result ) return s
error checking for routines that return explicitly sized strings .