Fix Jupyter (#1223)

* Call PyErr_Print() in QtResImport()

* Fix Jupyter
This commit is contained in:
Florian Märkl 2019-02-27 14:54:47 +01:00 committed by GitHub
parent 2208d3c134
commit 1f4339bed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View File

@ -1,2 +1,3 @@
jupyter
ipykernel==4.10.0
pyzmq==17.1.2

View File

@ -55,9 +55,13 @@ PyObject *QtResGetCode(const char *name)
PyObject *QtResImport(const char *name)
{
PyObject *codeObject = QtResGetCode(name);
if (!codeObject)
if (!codeObject) {
return nullptr;
}
PyObject *module = PyImport_ExecCodeModule(name, codeObject);
if (!module) {
PyErr_Print();
}
Py_DECREF(codeObject);
return module;
}

View File

@ -1,6 +1,13 @@
import json
from _cutter import *
from CutterBindings import *
try:
from CutterBindings import *
def core():
return CutterCore.instance()
except ImportError:
pass
def cmdj(command):
@ -8,5 +15,3 @@ def cmdj(command):
return json.loads(cmd(command))
def core():
return CutterCore.instance()