- if (PyObject_HasAttrString(data, (char*)"_is_a"))
- {
- PyObject *result = PyObject_CallMethod(data, (char*)"_is_a", (char*)"s",(char*)"IDL:SALOME/GenericObj:1.0");
- if(result && PyLong_Check(result))
- {
- if(PyLong_AS_LONG(result))
- {
- PyObject* o= PyObject_CallMethod(data, (char*)"Register", (char*)"") ;
- if(o)
- Py_XDECREF( o);
- else
- {
-#ifdef _DEVDEBUG_
- PyErr_Print();
-#else
- PyErr_Clear();
-#endif
- throw ConversionException("Corba object does not exist: you have perhaps forgotten to call Register on a GenericObj");
- }
- }
- Py_XDECREF(result);
- }
- if(!result)
- {
-#ifdef _DEVDEBUG_
- PyErr_Print();
-#else
- PyErr_Clear();
-#endif
- throw ConversionException("Corba object does not exist: you have perhaps forgotten to call Register on a GenericObj");
- }
- }