py3: ported Sandbox to python3

This commit is contained in:
wmayer
2016-01-23 18:07:00 +01:00
parent 4705980598
commit 70aebe98f1
2 changed files with 20 additions and 8 deletions

View File

@@ -236,17 +236,23 @@ private:
}
};
PyObject* initModule()
{
return (new Module)->module().ptr();
}
} // namespace Sandbox
/* Python entry */
PyMODINIT_FUNC initSandbox() {
PyMOD_INIT_FUNC(Sandbox)
{
Sandbox::DocumentProtector ::init();
Sandbox::SandboxObject ::init();
// the following constructor call registers our extension module
// with the Python runtime system
(void)new Sandbox::Module;
PyObject* mod = Sandbox::initModule();
Base::Console().Log("Loading Sandbox module... done\n");
PyMOD_Return(mod);
}