public object NoThrowTarget(CallSite site, object instance, CodeContext context) { OldInstance oi = instance as OldInstance; if (oi != null) { object res; if (oi.TryGetBoundCustomMember(context, _name, out res)) { return(res); } return(OperationFailed.Value); } return(((CallSite <Func <CallSite, object, CodeContext, object> >)site).Update(site, instance, context)); }
public object LightThrowTarget(CallSite site, object instance, CodeContext context) { OldInstance oi = instance as OldInstance; if (oi != null) { object res; if (oi.TryGetBoundCustomMember(context, _name, out res)) { return(res); } return(LightExceptions.Throw(PythonOps.AttributeError("{0} instance has no attribute '{1}'", oi._class.Name, _name))); } return(((CallSite <Func <CallSite, object, CodeContext, object> >)site).Update(site, instance, context)); }