Warnings removal

This commit is contained in:
xarkes 2018-02-22 19:51:02 +01:00 committed by xarkes
parent d23cc71b79
commit 3b8bdb6995

View File

@ -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);