mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-30 16:25:04 +00:00
Fix Jupyter (#1223)
* Call PyErr_Print() in QtResImport() * Fix Jupyter
This commit is contained in:
parent
2208d3c134
commit
1f4339bed2
@ -1,2 +1,3 @@
|
|||||||
jupyter
|
jupyter
|
||||||
ipykernel==4.10.0
|
ipykernel==4.10.0
|
||||||
|
pyzmq==17.1.2
|
||||||
|
@ -55,9 +55,13 @@ PyObject *QtResGetCode(const char *name)
|
|||||||
PyObject *QtResImport(const char *name)
|
PyObject *QtResImport(const char *name)
|
||||||
{
|
{
|
||||||
PyObject *codeObject = QtResGetCode(name);
|
PyObject *codeObject = QtResGetCode(name);
|
||||||
if (!codeObject)
|
if (!codeObject) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
PyObject *module = PyImport_ExecCodeModule(name, codeObject);
|
PyObject *module = PyImport_ExecCodeModule(name, codeObject);
|
||||||
|
if (!module) {
|
||||||
|
PyErr_Print();
|
||||||
|
}
|
||||||
Py_DECREF(codeObject);
|
Py_DECREF(codeObject);
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
import json
|
import json
|
||||||
from _cutter import *
|
from _cutter import *
|
||||||
|
|
||||||
|
try:
|
||||||
from CutterBindings import *
|
from CutterBindings import *
|
||||||
|
|
||||||
|
def core():
|
||||||
|
return CutterCore.instance()
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def cmdj(command):
|
def cmdj(command):
|
||||||
"""Execute a JSON command and return the result as a dictionary"""
|
"""Execute a JSON command and return the result as a dictionary"""
|
||||||
return json.loads(cmd(command))
|
return json.loads(cmd(command))
|
||||||
|
|
||||||
|
|
||||||
def core():
|
|
||||||
return CutterCore.instance()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user