Don't raise exception in tp_traverse, instead silently passing case where object is already destructed

This commit is contained in:
rdb 2015-08-28 16:28:03 +02:00
parent d68bbae5b4
commit 56b94eb815

View File

@ -2237,8 +2237,7 @@ write_module_class(ostream &out, Object *obj) {
out << " " << cClassName << " *local_this = NULL;\n"; out << " " << cClassName << " *local_this = NULL;\n";
out << " DTOOL_Call_ExtractThisPointerForType(self, &Dtool_" << ClassName << ", (void **) &local_this);\n"; out << " DTOOL_Call_ExtractThisPointerForType(self, &Dtool_" << ClassName << ", (void **) &local_this);\n";
out << " if (local_this == NULL) {\n"; out << " if (local_this == NULL) {\n";
out << " PyErr_SetString(PyExc_AttributeError, \"C++ object is not yet constructed, or already destructed.\");\n"; out << " return 0;\n";
out << " return -1;\n";
out << " }\n\n"; out << " }\n\n";
// Find the remap. There should be only one. // Find the remap. There should be only one.