mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
Fix issue with cmd/cmdj
This commit is contained in:
parent
98b9de504b
commit
efc7a7e90e
@ -20,9 +20,13 @@ PyObject *api_cmd(PyObject *self, PyObject *args)
|
||||
Q_UNUSED(self);
|
||||
char *command;
|
||||
char *result = (char*) "";
|
||||
QString cmdRes;
|
||||
QByteArray cmdBytes;
|
||||
if (PyArg_ParseTuple(args, "s:command", &command))
|
||||
{
|
||||
result = Core()->cmd(command).toLocal8Bit().data();
|
||||
cmdRes = Core()->cmd(command);
|
||||
cmdBytes = cmdRes.toLocal8Bit();
|
||||
result = cmdBytes.data();
|
||||
}
|
||||
return PyUnicode_FromString(result);
|
||||
}
|
||||
@ -32,9 +36,13 @@ PyObject *api_cmdj(PyObject *self, PyObject *args)
|
||||
Q_UNUSED(self);
|
||||
char *command;
|
||||
char *result = (char*) "";
|
||||
QString cmdRes;
|
||||
QByteArray cmdBytes;
|
||||
if (PyArg_ParseTuple(args, "s:command", &command))
|
||||
{
|
||||
result = Core()->cmd(command).toLocal8Bit().data();
|
||||
cmdRes = Core()->cmd(command);
|
||||
cmdBytes = cmdRes.toLocal8Bit();
|
||||
result = cmdBytes.data();
|
||||
PyObject *jsonModule = PyImport_ImportModule("json");
|
||||
PyObject *loadsFunc = PyObject_GetAttrString(jsonModule, "loads");
|
||||
if (!PyCallable_Check(loadsFunc)) {
|
||||
|
Loading…
Reference in New Issue
Block a user