fix __rsub__ nonsense

This commit is contained in:
David Rose 2005-12-08 22:40:50 +00:00
parent d48584de2f
commit 968ad486b8

View File

@ -638,21 +638,11 @@ void InterfaceMakerPythonNative::write_ClasseDetails(ostream &out, Object * obj)
ostringstream GetThis;
GetThis << " "<<cClassName << " * local_this = NULL;\n";
GetThis << " DTOOL_Call_ExtractThisPointerForType(self,&Dtool_"<< ClassName<<",(void **)&local_this);\n";
GetThis << " if(local_this == NULL)\n";
GetThis << " {\n";
GetThis << " if(!PyTuple_Check(args))\n";
GetThis << " {\n";
GetThis << " PyObject * temp = args;\n";
GetThis << " args = self;\n";
GetThis << " self = temp;\n";
GetThis << " DTOOL_Call_ExtractThisPointerForType(self,&Dtool_"<< ClassName<<",(void **)&local_this);\n";
GetThis << " }\n";
GetThis << " if(local_this == NULL)\n";
GetThis << " {\n";
GetThis << " PyErr_SetString(PyExc_TypeError, \"Error extracting 'this' pointer. Self is not a " << cClassName << "\");\n";
GetThis << " return (PyObject *) NULL;\n" ;
GetThis << " }\n";
GetThis << " };\n";
GetThis << " if(local_this == NULL) {\n";
GetThis << " // This might happen if Python called a reverse operator like __rsub__().\n";
GetThis << " Py_INCREF(Py_NotImplemented);\n";
GetThis << " return Py_NotImplemented;\n";
GetThis << " }\n";
write_function_for_top(out, func,GetThis.str());
}