py3: ported Draft to python3

This commit is contained in:
wmayer 2016-01-23 19:29:59 +01:00
parent 81464b5ef0
commit 8696ecdf9b

View File

@ -27,6 +27,7 @@
#endif
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Interpreter.h>
namespace DraftUtils {
@ -34,7 +35,7 @@ extern PyObject* initModule();
}
/* Python entry */
PyMODINIT_FUNC initDraftUtils()
PyMOD_INIT_FUNC(DraftUtils)
{
// load dependent module
try {
@ -42,8 +43,9 @@ PyMODINIT_FUNC initDraftUtils()
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
return;
PyMOD_Return(0);
}
(void)DraftUtils::initModule();
PyObject* mod = DraftUtils::initModule();
Base::Console().Log("Loading DraftUtils module... done\n");
PyMOD_Return(mod);
}