mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +00:00
Warnings removal
This commit is contained in:
parent
d23cc71b79
commit
3b8bdb6995
@ -47,9 +47,10 @@ PyObject *PyInit_api()
|
||||
|
||||
PyObject *api_internal_launch_ipykernel(PyObject *self, PyObject *args, PyObject *kw)
|
||||
{
|
||||
QStringList argv;
|
||||
Q_UNUSED(self);
|
||||
Q_UNUSED(kw);
|
||||
|
||||
{
|
||||
QStringList argv;
|
||||
PyObject *argvListObject;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O", &argvListObject)
|
||||
@ -65,13 +66,9 @@ PyObject *api_internal_launch_ipykernel(PyObject *self, PyObject *args, PyObject
|
||||
QString s = QString::fromUtf8(PyUnicode_AsUTF8(o));
|
||||
argv.append(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PyThreadState *parentThreadState = PyThreadState_Get();
|
||||
|
||||
PyThreadState *threadState = Py_NewInterpreter();
|
||||
|
||||
QFile moduleFile(":/python/cutter_ipykernel.py");
|
||||
moduleFile.open(QIODevice::ReadOnly);
|
||||
QByteArray moduleCode = moduleFile.readAll();
|
||||
@ -93,15 +90,15 @@ PyObject *api_internal_launch_ipykernel(PyObject *self, PyObject *args, PyObject
|
||||
|
||||
auto launchFunc = PyObject_GetAttrString(cutterIPykernelModule, "launch_ipykernel");
|
||||
|
||||
PyObject *argvListObject = PyList_New(argv.size());
|
||||
argvListObject = PyList_New(argv.size());
|
||||
for (int i = 0; i < argv.size(); i++)
|
||||
{
|
||||
QString s = argv[i];
|
||||
PyList_SetItem(argvListObject, i, PyUnicode_DecodeUTF8(s.toUtf8().constData(), s.length(), nullptr));
|
||||
}
|
||||
|
||||
|
||||
auto ipyKernel = PyObject_CallFunction(launchFunc, "O", argvListObject);
|
||||
Q_UNUSED(ipyKernel);
|
||||
|
||||
PyThreadState_Swap(parentThreadState);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user