diff --git a/src/utils/JupyterConnection.cpp b/src/utils/JupyterConnection.cpp index 102297d0..c2de55a0 100644 --- a/src/utils/JupyterConnection.cpp +++ b/src/utils/JupyterConnection.cpp @@ -81,7 +81,9 @@ void JupyterConnection::initPython() void JupyterConnection::createCutterJupyterModule() { - PyEval_RestoreThread(pyThreadState); + if (pyThreadState) { + PyEval_RestoreThread(pyThreadState); + } QFile moduleFile(":/python/cutter_jupyter.py"); moduleFile.open(QIODevice::ReadOnly);