deps/PicklingTools170Release/Xm/ptools170/pythoncext/pyocser.cc
static PyObject* /* new ref */
dynamic_check (const char* module, const char* type)
{
  // Try to import  to get the type object therein
  PyObject *mood = PyImport_ImportModule((char*)module);
  if (mood==NULL) { // Not there!
    PyErr_Clear();
    return NULL;
  }
  // Okay, we can get the module, can we get the type object?
  PyObject *callable = PyObject_GetAttrString(mood, (char*)type); // new ref
  if (callable==NULL) {
    PyErr_Clear();
    return NULL;
  }
  int check = PyCallable_Check(callable);
  if (!check) {
    Py_DECREF(callable);
    return NULL;
  }
  PyObject *args     = NULL; 
  if (string(type)=="array") {
    args     = Py_BuildValue((char*)"([i],s)", 1,"i");          // new ref
  } else  {
    args     = Py_BuildValue((char*)"()");          // new ref
  }

  PyObject *res      = PyEval_CallObject(callable, args);        // new ref
  
  Py_DECREF(callable);
  Py_DECREF(args);
  
  return res;
}
// Dynamically import the module, see if we can create a prototype object
Dynamically import the module, see if we can create a prototype object
Dynamically import the module see if we can create a prototype object
static PyObject* 
dynamic_check (const char* module, const char* type)
{
  PyObject *mood = PyImport_ImportModule((char*)module);
  if (mood==NULL) { 
    PyErr_Clear();
    return NULL;
  }
  PyObject *callable = PyObject_GetAttrString(mood, (char*)type); 
  if (callable==NULL) {
    PyErr_Clear();
    return NULL;
  }
  int check = PyCallable_Check(callable);
  if (!check) {
    Py_DECREF(callable);
    return NULL;
  }
  PyObject *args     = NULL; 
  if (string(type)=="array") {
    args     = Py_BuildValue((char*)"([i],s)", 1,"i");          
  } else  {
    args     = Py_BuildValue((char*)"()");          
  }
  PyObject *res      = PyEval_CallObject(callable, args);        
  Py_DECREF(callable);
  Py_DECREF(args);
  return res;
}
static PyObject * dynamic_check ( const char * module , const char * type ) { PyObject * mood = PyImport_ImportModule ( ( char * ) module ) ; if ( mood == NULL ) { PyErr_Clear ( ) ; return NULL ; } PyObject * callable = PyObject_GetAttrString ( mood , ( char * ) type ) ; if ( callable == NULL ) { PyErr_Clear ( ) ; return NULL ; } int check = PyCallable_Check ( callable ) ; if ( ! check ) { Py_DECREF ( callable ) ; return NULL ; } PyObject * args = NULL ; if ( string ( type ) == " " ) { args = Py_BuildValue ( ( char * ) " " , 1 , " " ) ; } else { args = Py_BuildValue ( ( char * ) " " ) ; } PyObject * res = PyEval_CallObject ( callable , args ) ; Py_DECREF ( callable ) ; Py_DECREF ( args ) ; return res ; }
Dynamically import the module, see if we can create a prototype object
Dynamically import the module see if we can create a prototype object
/* new ref */ // Try to import  to get the type object therein // Not there! // Okay, we can get the module, can we get the type object? // new ref // new ref // new ref // new ref