| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,13 +17,13 @@ internal class MethodBinding : ExtensionType | |||
| 17 | 17 | internal MaybeMethodInfo info; | |
| 18 | 18 | internal MethodObject m; | |
| 19 | 19 | internal PyObject? target; | |
| 20 | - internal PyType targetType; | ||
| 20 | + internal PyType? targetType; | ||
| 21 | 21 | ||
| 22 | 22 | public MethodBinding(MethodObject m, PyObject? target, PyType? targetType = null) | |
| 23 | 23 | { | |
| 24 | 24 | this.target = target; | |
| 25 | 25 | ||
| 26 | - this.targetType = targetType ?? target.GetPythonType(); | ||
| 26 | + this.targetType = targetType ?? target?.GetPythonType(); | ||
| 27 | 27 | ||
| 28 | 28 | this.info = null; | |
| 29 | 29 | this.m = m; | |
@@ -48,7 +48,7 @@ public static NewReference mp_subscript(BorrowedReference tp, BorrowedReference | |||
| 48 | 48 | return Exceptions.RaiseTypeError("No match found for given type params"); | |
| 49 | 49 | } | |
| 50 | 50 | ||
| 51 | - var mb = new MethodBinding(self.m, self.target) { info = mi }; | ||
| 51 | + var mb = new MethodBinding(self.m, self.target, self.targetType) { info = mi }; | ||
| 52 | 52 | return new NewReference(mb.pyHandle); | |
| 53 | 53 | } | |
| 54 | 54 | ||
@@ -289,12 +289,5 @@ protected override void Clear(BorrowedReference ob) | |||
| 289 | 289 | this.targetType = null!; | |
| 290 | 290 | base.Clear(ob); | |
| 291 | 291 | } | |
| 292 | - | ||
| 293 | - protected override void OnSave(InterDomainContext context) | ||
| 294 | - { | ||
| 295 | - base.OnSave(context); | ||
| 296 | - Runtime.XIncref(target); | ||
| 297 | - Runtime.XIncref(targetType); | ||
| 298 | - } | ||
| 299 | 292 | } | |
| 300 | 293 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments