def _unwrap_object(self, space, w_obj): from pypy.module.cppyy.interp_cppyy import W_CPPInstance if isinstance(w_obj, W_CPPInstance): arg = InstanceConverter._unwrap_object(self, space, w_obj) return capi.c_stdstring2stdstring(space, arg) else: return capi.c_charp2stdstring(space, space.str_w(w_obj))
def _unwrap_object(self, space, w_obj): try: return capi.c_charp2stdstring(space, space.str_w(w_obj)) except Exception, e: arg = InstanceConverter._unwrap_object(self, space, w_obj) result = capi.c_stdstring2stdstring(space, arg) return result
def _unwrap_object(self, space, w_obj): try: charp = rffi.str2charp(space.str_w(w_obj)) arg = capi.c_charp2stdstring(charp) rffi.free_charp(charp) return arg except OperationError: arg = InstanceConverter._unwrap_object(self, space, w_obj) return capi.c_stdstring2stdstring(arg)