diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index c07e6af50f..eba00431d3 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -1212,6 +1212,10 @@ write_sub_module(ostream &out, Object *obj) { out << " assert(" << class_ptr << " != NULL);\n"; } else { class_ptr = "&Dtool_" + class_name; + + // If this is a typedef to a class defined in the same module, make sure + // that the class is initialized before we try to define the typedef. + out << " Dtool_PyModuleClassInit_" << class_name << "(module);\n"; } } @@ -2692,6 +2696,12 @@ write_module_class(ostream &out, Object *obj) { out << "#if PY_VERSION_HEX >= 0x02050000\n"; write_function_slot(out, 2, slots, "nb_index"); out << "#endif\n"; + + out << "#if PY_VERSION_HEX >= 0x03050000\n"; + write_function_slot(out, 2, slots, "nb_matrix_multiply"); + write_function_slot(out, 2, slots, "nb_inplace_matrix_multiply"); + out << "#endif\n"; + out << "};\n\n"; // NB: it's tempting not to write this table when a class doesn't have them. @@ -2938,6 +2948,10 @@ write_module_class(ostream &out, Object *obj) { out << "#if PY_VERSION_HEX >= 0x02060000\n"; out << " 0, // tp_version_tag\n"; out << "#endif\n"; + // destructor tp_finalize + out << "#if PY_VERSION_HEX >= 0x03040000\n"; + out << " 0, // tp_finalize\n"; + out << "#endif\n"; out << " },\n"; // It's tempting to initialize the type handle here, but this causes static