From 1793c9a93845278ad98f39d2811ca142b1e69386 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 31 Dec 2020 18:11:50 +0100 Subject: [PATCH] interrogate: Fix __setstate__ not working for subclasses --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index eea5ee7329..459ed7d5e5 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -3624,8 +3624,8 @@ write_function_for_name(ostream &out, Object *obj, error_return(out, 4, return_flags); out << " }\n" << " " << cClassName << " *local_this = new " << cClassName << ";\n" - << " DTool_PyInit_Finalize(self, local_this, &Dtool_" << ClassName - << ", false, false);\n" + << " DTool_PyInit_Finalize(self, local_this, " + << "((Dtool_PyInstDef *)self)->_My_Type, false, false);\n" << " if (local_this == nullptr) {\n" << " PyErr_NoMemory();\n"; }