Skip to content

Commit bc7b74b

Browse files
author
Rickard Holmberg
committed
Remove __init__ call from ClassDerived.InvokeCtor
1 parent 5f9a108 commit bc7b74b

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/runtime/classderived.cs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Reflection;
@@ -829,26 +829,6 @@ public static void InvokeCtor(IPythonDerivedType obj, string origCtorName, objec
829829
Runtime.XIncref(Runtime.PyNone);
830830
var pynone = new PyObject(Runtime.PyNone);
831831
disposeList.Add(pynone);
832-
833-
// call __init__
834-
PyObject init = pyself.GetAttr("__init__", pynone);
835-
disposeList.Add(init);
836-
if (init.Handle != Runtime.PyNone)
837-
{
838-
// if __init__ hasn't been overridden then it will be a managed object
839-
ManagedType managedMethod = ManagedType.GetManagedObject(init.Handle);
840-
if (null == managedMethod)
841-
{
842-
var pyargs = new PyObject[args.Length];
843-
for (var i = 0; i < args.Length; ++i)
844-
{
845-
pyargs[i] = new PyObject(Converter.ToPython(args[i], args[i]?.GetType()));
846-
disposeList.Add(pyargs[i]);
847-
}
848-
849-
disposeList.Add(init.Invoke(pyargs));
850-
}
851-
}
852832
}
853833
finally
854834
{

0 commit comments

Comments
 (0)