@@ -108,49 +108,45 @@ func makeStructFieldDescriptor(t *Type, fieldName, propertyName string, writtabl
108108 setter := None
109109
110110 getterFunc := func (f * Frame , args Args , _ KWArgs ) (* Object , * BaseException ) {
111- var ret * Object
112111 var raised * BaseException
113-
114112 if raised = checkFunctionArgs (f , fieldName , args , ObjectType ); raised != nil {
115- return ret , raised
113+ return nil , raised
116114 }
117115
118116 self := args [0 ]
119117 if ! self .isInstance (t ) {
120118 format := "descriptor '%s' for '%s' objects doesn't apply to '%s' objects"
121119 raised = f .RaiseType (TypeErrorType , fmt .Sprintf (format , propertyName , t .Name (), self .typ .Name ()))
122- return ret , raised
120+ return nil , raised
123121 }
124122
125- ret , raised = WrapNative (f , t .slots .Basis .Fn (self ).FieldByIndex (field .Index ))
126- return ret , raised
123+ return WrapNative (f , t .slots .Basis .Fn (self ).FieldByIndex (field .Index ))
127124 }
128125
129126 if writtable {
130127 setterFunc := func (f * Frame , args Args , _ KWArgs ) (* Object , * BaseException ) {
131- ret := None
132128 var raised * BaseException
133129 if raised = checkFunctionArgs (f , fieldName , args , ObjectType , ObjectType ); raised != nil {
134- return ret , raised
130+ return nil , raised
135131 }
136132
137133 self := args [0 ]
138134 newvalue := args [1 ]
139135 if ! newvalue .isInstance (getNativeType (field .Type )) {
140136 format := "descriptor '%s' for '%s' objects doesn't apply to '%s' objects"
141137 raised = f .RaiseType (TypeErrorType , fmt .Sprintf (format , propertyName , t .Name (), newvalue .typ .Name ()))
142- return ret , raised
138+ return nil , raised
143139 }
144140
145141 var converted reflect.Value
146142 val := t .slots .Basis .Fn (self ).FieldByIndex (field .Index )
147143
148144 if converted , raised = maybeConvertValue (f , newvalue , val .Type ()); raised != nil {
149- return ret , raised
145+ return nil , raised
150146 }
151147
152148 val .Set (converted )
153- return ret , raised
149+ return None , raised
154150 }
155151
156152 setter = newBuiltinFunction ("_set" + fieldName , setterFunc ).ToObject ()
0 commit comments