Commit dab6fee6 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

[Exception] module not available in its definition

As PyState_AddModule is not yet called in the module definition,
PyState_FindModule will not work, so for Python 3 we need to get the
module from the methods definition to retrieve a pointer to dgpyError.

Fix #39
parent 7dc6728c
......@@ -178,12 +178,12 @@ __attribute__((unused)) static struct PyModuleDef dynamicGraphModuleDef = {
NULL,
NULL};
#define GETSTATE(m) ((struct dynamicgraph::python::module_state*)PyModule_GetState(m))
#define DGPYERROR GETSTATE(PyState_FindModule(&dynamicGraphModuleDef))->dgpyError
#define DGPYERROR(m) GETSTATE(m)->dgpyError
#define INITERROR return NULL
#else
__attribute__((unused)) static struct module_state _state;
#define GETSTATE(m) (&dynamicgraph::python::_state)
#define DGPYERROR dynamicgraph::python::_state.dgpyError
#define DGPYERROR(m) dynamicgraph::python::_state.dgpyError
#define INITERROR return
#endif
......
......@@ -7,19 +7,19 @@
/// \brief Catch all exceptions which may be sent when C++ code is
/// called.
#define CATCH_ALL_EXCEPTIONS() \
catch (const std::exception& exc) { \
PyErr_SetString(DGPYERROR, exc.what()); \
return NULL; \
} \
catch (const char* s) { \
PyErr_SetString(DGPYERROR, s); \
return NULL; \
} \
catch (...) { \
PyErr_SetString(DGPYERROR, "Unknown exception"); \
return NULL; \
} \
#define CATCH_ALL_EXCEPTIONS(m) \
catch (const std::exception& exc) { \
PyErr_SetString(DGPYERROR(m), exc.what()); \
return NULL; \
} \
catch (const char* s) { \
PyErr_SetString(DGPYERROR(m), s); \
return NULL; \
} \
catch (...) { \
PyErr_SetString(DGPYERROR(m), "Unknown exception"); \
return NULL; \
} \
struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
#endif //! DYNAMIC_GRAPH_PYTHON_EXCEPTION
......@@ -25,7 +25,7 @@ namespace debug {
std::map<std::string, ofstreamShrPtr> mapOfFiles_;
PyObject* addLoggerFileOutputStream(PyObject* /*self*/, PyObject* args) {
PyObject* addLoggerFileOutputStream(PyObject* m, PyObject* args) {
char* filename;
if (!PyArg_ParseTuple(args, "s", &filename)) return NULL;
std::string sfilename(filename);
......@@ -38,49 +38,49 @@ PyObject* addLoggerFileOutputStream(PyObject* /*self*/, PyObject* args) {
dgRTLOG() << "Added " << filename << " as an output stream \n";
mapOfFiles_[sfilename] = ofs_shrptr;
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
PyObject* closeLoggerFileOutputStream(PyObject* /*self*/, PyObject* /*args */) {
PyObject* closeLoggerFileOutputStream(PyObject* m, PyObject* /*args */) {
try {
for (std::map<std::string, ofstreamShrPtr>::iterator it = mapOfFiles_.begin(); it != mapOfFiles_.end(); ++it) {
it->second->close();
}
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
PyObject* addLoggerCoutOutputStream(PyObject* /*self*/, PyObject* /*args*/) {
PyObject* addLoggerCoutOutputStream(PyObject* m, PyObject* /*args*/) {
try {
dgADD_OSTREAM_TO_RTLOG(std::cout);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
PyObject* realTimeLoggerDestroy(PyObject* /*self*/, PyObject* /*args*/) {
PyObject* realTimeLoggerDestroy(PyObject* m, PyObject* /*args*/) {
try {
RealTimeLogger::destroy();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
PyObject* realTimeLoggerSpinOnce(PyObject* /*self*/, PyObject* /*args*/) {
PyObject* realTimeLoggerSpinOnce(PyObject* m, PyObject* /*args*/) {
try {
RealTimeLogger::instance().spinOnce();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
PyObject* realTimeLoggerInstance(PyObject* /*self*/, PyObject* /*args*/) {
PyObject* realTimeLoggerInstance(PyObject* m, PyObject* /*args*/) {
try {
RealTimeLogger::instance();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
......
......@@ -17,7 +17,7 @@ namespace python {
/**
\brief plug a signal into another one.
*/
PyObject* plug(PyObject* /*self*/, PyObject* args) {
PyObject* plug(PyObject* m, PyObject* args) {
PyObject* objOut = NULL;
PyObject* objIn = NULL;
void* pObjOut;
......@@ -61,11 +61,11 @@ PyObject* plug(PyObject* /*self*/, PyObject* args) {
try {
signalIn->plug(signalOut);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
PyObject* enableTrace(PyObject* /*self*/, PyObject* args) {
PyObject* enableTrace(PyObject* m, PyObject* args) {
PyObject* boolean;
char* filename = NULL;
......@@ -82,12 +82,12 @@ PyObject* enableTrace(PyObject* /*self*/, PyObject* args) {
try {
DebugTrace::openFile(filename);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
} else {
try {
DebugTrace::closeFile(filename);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
}
} else {
return NULL;
......
......@@ -37,7 +37,7 @@ namespace entity {
/**
\brief Create an instance of Entity
*/
PyObject* create(PyObject* /*self*/, PyObject* args) {
PyObject* create(PyObject* m, PyObject* args) {
char* className = NULL;
char* instanceName = NULL;
......@@ -51,7 +51,7 @@ PyObject* create(PyObject* /*self*/, PyObject* args) {
",\n"
"but this object is of type " +
std::string(obj->getClassName()) + " and not " + std::string(className));
PyErr_SetString(DGPYERROR, msg.c_str());
PyErr_SetString(DGPYERROR(m), msg.c_str());
return NULL;
}
} else /* If not, create a new object. */
......@@ -59,7 +59,7 @@ PyObject* create(PyObject* /*self*/, PyObject* args) {
try {
obj = dynamicgraph::FactoryStorage::getInstance()->newEntity(std::string(className), std::string(instanceName));
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
}
// Return the pointer as a PyCapsule
......@@ -69,7 +69,7 @@ PyObject* create(PyObject* /*self*/, PyObject* args) {
/**
\brief Get name of entity
*/
PyObject* getName(PyObject* /*self*/, PyObject* args) {
PyObject* getName(PyObject* m, PyObject* args) {
PyObject* object = NULL;
void* pointer = NULL;
std::string name;
......@@ -86,14 +86,14 @@ PyObject* getName(PyObject* /*self*/, PyObject* args) {
try {
name = entity->getName();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("s", name.c_str());
}
/**
\brief Get class name of entity
*/
PyObject* getClassName(PyObject* /*self*/, PyObject* args) {
PyObject* getClassName(PyObject* m, PyObject* args) {
PyObject* object = NULL;
void* pointer = NULL;
std::string name;
......@@ -110,14 +110,14 @@ PyObject* getClassName(PyObject* /*self*/, PyObject* args) {
try {
name = entity->getClassName();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("s", name.c_str());
}
/**
\brief Check if the entity has a signal with the given name
*/
PyObject* hasSignal(PyObject* /*self*/, PyObject* args) {
PyObject* hasSignal(PyObject* m, PyObject* args) {
char* name = NULL;
PyObject* object = NULL;
void* pointer = NULL;
......@@ -136,7 +136,7 @@ PyObject* hasSignal(PyObject* /*self*/, PyObject* args) {
try {
hasSignal = entity->hasSignal(std::string(name));
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
if (hasSignal)
Py_RETURN_TRUE;
......@@ -147,7 +147,7 @@ PyObject* hasSignal(PyObject* /*self*/, PyObject* args) {
/**
\brief Get a signal by name
*/
PyObject* getSignal(PyObject* /*self*/, PyObject* args) {
PyObject* getSignal(PyObject* m, PyObject* args) {
char* name = NULL;
PyObject* object = NULL;
void* pointer = NULL;
......@@ -166,14 +166,14 @@ PyObject* getSignal(PyObject* /*self*/, PyObject* args) {
try {
signal = &(entity->getSignal(std::string(name)));
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
// Return the pointer to the signal without destructor since the signal
// is not owned by the calling object but by the Entity.
return PyCapsule_New((void*)signal, "dynamic_graph.Signal", NULL);
}
PyObject* listSignals(PyObject* /*self*/, PyObject* args) {
PyObject* listSignals(PyObject* m, PyObject* args) {
void* pointer = NULL;
PyObject* object = NULL;
......@@ -198,11 +198,17 @@ PyObject* listSignals(PyObject* /*self*/, PyObject* args) {
}
return result;
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return NULL;
}
PyObject* executeCommand(PyObject* /*self*/, PyObject* args) {
PyObject* executeCommand(
#if PY_MAJOR_VERSION >= 3
PyObject* m, PyObject* args
#else
PyObject* , PyObject* args
#endif
) {
PyObject* object = NULL;
PyObject* argTuple = NULL;
char* commandName = NULL;
......@@ -236,7 +242,7 @@ PyObject* executeCommand(PyObject* /*self*/, PyObject* args) {
if ((unsigned)size != typeVector.size()) {
std::stringstream ss;
ss << "command takes " << typeVector.size() << " parameters, " << size << " given.";
PyErr_SetString(DGPYERROR, ss.str().c_str());
PyErr_SetString(DGPYERROR(m), ss.str().c_str());
return NULL;
}
std::vector<Value> valueVector;
......@@ -249,10 +255,10 @@ PyObject* executeCommand(PyObject* /*self*/, PyObject* args) {
} catch (const std::exception& exc) {
std::stringstream ss;
ss << "while parsing argument " << iParam + 1 << ": expecting " << exc.what() << ".";
PyErr_SetString(DGPYERROR, ss.str().c_str());
PyErr_SetString(DGPYERROR(m), ss.str().c_str());
return NULL;
} catch (...) {
PyErr_SetString(DGPYERROR, "Unknown exception");
PyErr_SetString(DGPYERROR(m), "Unknown exception");
return NULL;
}
}
......@@ -261,7 +267,7 @@ PyObject* executeCommand(PyObject* /*self*/, PyObject* args) {
Value result = command->execute();
return valueToPython(result);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return NULL;
}
......@@ -292,7 +298,7 @@ PyObject* listCommands(PyObject* /*self*/, PyObject* args) {
}
return result;
}
PyObject* getCommandDocstring(PyObject* /*self*/, PyObject* args) {
PyObject* getCommandDocstring(PyObject* m, PyObject* args) {
PyObject* object = NULL;
char* commandName;
if (!PyArg_ParseTuple(args, "Os", &object, &commandName)) {
......@@ -301,7 +307,7 @@ PyObject* getCommandDocstring(PyObject* /*self*/, PyObject* args) {
// Retrieve the entity instance
if (!PyCapsule_CheckExact(object)) {
PyErr_SetString(DGPYERROR, "first argument is not an object");
PyErr_SetString(DGPYERROR(m), "first argument is not an object");
return NULL;
}
void* pointer = PyCapsule_GetPointer(object, "dynamic_graph.Entity");
......@@ -322,7 +328,7 @@ PyObject* getCommandDocstring(PyObject* /*self*/, PyObject* args) {
return Py_BuildValue("s", docstring.c_str());
}
PyObject* getDocString(PyObject* /*self*/, PyObject* args) {
PyObject* getDocString(PyObject* m, PyObject* args) {
PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) {
return NULL;
......@@ -330,7 +336,7 @@ PyObject* getDocString(PyObject* /*self*/, PyObject* args) {
// Retrieve the entity instance
if (!PyCapsule_CheckExact(object)) {
PyErr_SetString(DGPYERROR, "first argument is not an object");
PyErr_SetString(DGPYERROR(m), "first argument is not an object");
return NULL;
}
void* pointer = PyCapsule_GetPointer(object, "dynamic_graph.Entity");
......@@ -338,20 +344,20 @@ PyObject* getDocString(PyObject* /*self*/, PyObject* args) {
try {
return Py_BuildValue("s", entity->getDocString().c_str());
} catch (const std::exception& exc) {
PyErr_SetString(DGPYERROR, exc.what());
PyErr_SetString(DGPYERROR(m), exc.what());
return NULL;
} catch (...) {
PyErr_SetString(DGPYERROR, "Unknown exception");
PyErr_SetString(DGPYERROR(m), "Unknown exception");
return NULL;
}
return NULL;
}
PyObject* display(PyObject* /*self*/, PyObject* args) {
PyObject* display(PyObject* m, PyObject* args) {
/* Retrieve the entity instance. */
PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object) || (!PyCapsule_CheckExact(object))) {
PyErr_SetString(DGPYERROR, "first argument is not an object");
PyErr_SetString(DGPYERROR(m), "first argument is not an object");
return NULL;
}
void* pointer = PyCapsule_GetPointer(object, "dynamic_graph.Entity");
......@@ -368,7 +374,7 @@ PyObject* display(PyObject* /*self*/, PyObject* args) {
/**
\brief Set verbosity Level
*/
PyObject* setLoggerVerbosityLevel(PyObject* /*self*/, PyObject* args) {
PyObject* setLoggerVerbosityLevel(PyObject* m, PyObject* args) {
PyObject* object = NULL;
PyObject* objectVerbosityLevel = NULL;
if (!PyArg_ParseTuple(args, "OO", &object, &objectVerbosityLevel)) return NULL;
......@@ -408,13 +414,13 @@ PyObject* setLoggerVerbosityLevel(PyObject* /*self*/, PyObject* args) {
break;
}
} catch (const std::exception& exc) {
PyErr_SetString(DGPYERROR, exc.what());
PyErr_SetString(DGPYERROR(m), exc.what());
return NULL;
} catch (const char* s) {
PyErr_SetString(DGPYERROR, s);
PyErr_SetString(DGPYERROR(m), s);
return NULL;
} catch (...) {
PyErr_SetString(DGPYERROR, "Unknown exception");
PyErr_SetString(DGPYERROR(m), "Unknown exception");
return NULL;
}
......@@ -424,7 +430,7 @@ PyObject* setLoggerVerbosityLevel(PyObject* /*self*/, PyObject* args) {
/**
\brief Get verbosity Level
*/
PyObject* getLoggerVerbosityLevel(PyObject* /*self*/, PyObject* args) {
PyObject* getLoggerVerbosityLevel(PyObject* m, PyObject* args) {
PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
......@@ -441,7 +447,7 @@ PyObject* getLoggerVerbosityLevel(PyObject* /*self*/, PyObject* args) {
try {
alv = entity->getLoggerVerbosityLevel();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
int ares = (int)alv;
return Py_BuildValue("i", ares);
......@@ -450,7 +456,7 @@ PyObject* getLoggerVerbosityLevel(PyObject* /*self*/, PyObject* args) {
/**
\brief Get stream print period
*/
PyObject* getStreamPrintPeriod(PyObject* /*self*/, PyObject* args) {
PyObject* getStreamPrintPeriod(PyObject* m, PyObject* args) {
PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
......@@ -467,7 +473,7 @@ PyObject* getStreamPrintPeriod(PyObject* /*self*/, PyObject* args) {
try {
r = entity->getStreamPrintPeriod();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("d", r);
}
......@@ -475,7 +481,7 @@ PyObject* getStreamPrintPeriod(PyObject* /*self*/, PyObject* args) {
/**
\brief Set print period
*/
PyObject* setStreamPrintPeriod(PyObject* /*self*/, PyObject* args) {
PyObject* setStreamPrintPeriod(PyObject* m, PyObject* args) {
PyObject* object = NULL;
double streamPrintPeriod = 0;
if (!PyArg_ParseTuple(args, "Od", &object, &streamPrintPeriod)) return NULL;
......@@ -493,13 +499,13 @@ PyObject* setStreamPrintPeriod(PyObject* /*self*/, PyObject* args) {
entity->setStreamPrintPeriod(streamPrintPeriod);
} catch (const std::exception& exc) {
PyErr_SetString(DGPYERROR, exc.what());
PyErr_SetString(DGPYERROR(m), exc.what());
return NULL;
} catch (const char* s) {
PyErr_SetString(DGPYERROR, s);
PyErr_SetString(DGPYERROR(m), s);
return NULL;
} catch (...) {
PyErr_SetString(DGPYERROR, "Unknown exception");
PyErr_SetString(DGPYERROR(m), "Unknown exception");
return NULL;
}
......@@ -509,7 +515,7 @@ PyObject* setStreamPrintPeriod(PyObject* /*self*/, PyObject* args) {
/**
\brief Get stream print period
*/
PyObject* getTimeSample(PyObject* /*self*/, PyObject* args) {
PyObject* getTimeSample(PyObject* m, PyObject* args) {
PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
......@@ -526,7 +532,7 @@ PyObject* getTimeSample(PyObject* /*self*/, PyObject* args) {
try {
r = entity->getTimeSample();
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("d", r);
}
......@@ -534,7 +540,7 @@ PyObject* getTimeSample(PyObject* /*self*/, PyObject* args) {
/**
\brief Set time sample
*/
PyObject* setTimeSample(PyObject* /*self*/, PyObject* args) {
PyObject* setTimeSample(PyObject* m, PyObject* args) {
PyObject* object = NULL;
double timeSample;
if (!PyArg_ParseTuple(args, "Od", &object, &timeSample)) return NULL;
......@@ -552,13 +558,13 @@ PyObject* setTimeSample(PyObject* /*self*/, PyObject* args) {
entity->setTimeSample(timeSample);
} catch (const std::exception& exc) {
PyErr_SetString(DGPYERROR, exc.what());
PyErr_SetString(DGPYERROR(m), exc.what());
return NULL;
} catch (const char* s) {
PyErr_SetString(DGPYERROR, s);
PyErr_SetString(DGPYERROR(m), s);
return NULL;
} catch (...) {
PyErr_SetString(DGPYERROR, "Unknown exception");
PyErr_SetString(DGPYERROR(m), "Unknown exception");
return NULL;
}
......
......@@ -12,20 +12,20 @@ namespace python {
namespace pool {
PyObject* writeGraph(PyObject* /*self*/, PyObject* args) {
PyObject* writeGraph(PyObject* m, PyObject* args) {
char* filename;
if (!PyArg_ParseTuple(args, "s", &filename)) return NULL;
try {
PoolStorage::getInstance()->writeGraph(filename);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("");
}
/**
\brief Get list of entities
*/
PyObject* getEntityList(PyObject* /*self*/, PyObject* args) {
PyObject* getEntityList(PyObject* m, PyObject* args) {
if (!PyArg_ParseTuple(args, "")) return NULL;
std::vector<std::string> entityNames;
......@@ -47,7 +47,7 @@ PyObject* getEntityList(PyObject* /*self*/, PyObject* args) {
}
return Py_BuildValue("O", classTuple);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return NULL;
}
......
......@@ -57,20 +57,21 @@ PythonSignalContainer* getPythonSignalContainer() {
const std::string instanceName = "python_signals";
const std::string className = "PythonSignalContainer";
Entity* obj;
PyObject* m = PyState_FindModule(&dynamicgraph::python::dynamicGraphModuleDef);
if (PoolStorage::getInstance()->existEntity(instanceName, obj)) {
if (obj->getClassName() != className) {
std::string msg("Found an object named " + std::string(instanceName) +
",\n"
"but this object is of type " +
std::string(obj->getClassName()) + " and not " + std::string(className));
PyErr_SetString(DGPYERROR, msg.c_str());
PyErr_SetString(DGPYERROR(m), msg.c_str());
return NULL;
}
} else {
try {
obj = FactoryStorage::getInstance()->newEntity(std::string(className), std::string(instanceName));
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
}
return dynamic_cast<PythonSignalContainer*>(obj);
}
......@@ -83,7 +84,7 @@ PythonSignalContainer* getPythonSignalContainer() {
/**
\brief Create an instance of SignalWrapper
*/
PyObject* createSignalWrapper(PyObject* /*self*/, PyObject* args) {
PyObject* createSignalWrapper(PyObject* m, PyObject* args) {
PythonSignalContainer* psc = getPythonSignalContainer();
if (psc == NULL) return NULL;
......@@ -109,7 +110,7 @@ PyObject* createSignalWrapper(PyObject* /*self*/, PyObject* args) {
}
if (obj == NULL) {
PyErr_SetString(DGPYERROR, error.c_str());
PyErr_SetString(DGPYERROR(m), error.c_str());
return NULL;
}
// Register signal into the python signal container
......@@ -140,13 +141,13 @@ PyObject* getTime(PyObject* /*self*/, PyObject* args) {
return Py_BuildValue("i", time);
}
PyObject* setTime(PyObject* /*self*/, PyObject* args) {
PyObject* setTime(PyObject* m, PyObject* args) {
void* pointer = NULL;
PyObject* object = NULL;
int time;
if (!PyArg_ParseTuple(args, "Oi", &object, &time)) return NULL;
if (!PyCapsule_CheckExact(object)) {
PyErr_SetString(DGPYERROR, "object should be a C object");
PyErr_SetString(DGPYERROR(m), "object should be a C object");
return NULL;
}
......@@ -157,7 +158,7 @@ PyObject* setTime(PyObject* /*self*/, PyObject* args) {
return Py_BuildValue("");
}
PyObject* display(PyObject* /*self*/, PyObject* args) {
PyObject* display(PyObject* m, PyObject* args) {
void* pointer = NULL;
PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
......@@ -170,12 +171,12 @@ PyObject* display(PyObject* /*self*/, PyObject* args) {
try {
obj->display(oss);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("s", oss.str().c_str());
}
PyObject* displayDependencies(PyObject* /*self*/, PyObject* args) {
PyObject* displayDependencies(PyObject* m, PyObject* args) {
void* pointer = NULL;
PyObject* object = NULL;
int time;
......@@ -189,11 +190,11 @@ PyObject* displayDependencies(PyObject* /*self*/, PyObject* args) {
try {
obj->displayDependencies(oss, time);
}
CATCH_ALL_EXCEPTIONS();
CATCH_ALL_EXCEPTIONS(m);
return Py_BuildValue("s", oss.str().c_str());
}
PyObject* getValue(PyObject* /*self*/, PyObject* args) {
PyObject* getValue(PyObject* m, PyObject* args) {