mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
Fix Segfault when jupyter is not installed
This commit is contained in:
parent
3cdc6a5230
commit
5313017c54
@ -109,10 +109,14 @@ QVariant JupyterConnection::pollNestedIPyKernel(long id)
|
||||
|
||||
bool JupyterConnection::startJupyterNotebook()
|
||||
{
|
||||
Python()->restoreThread();
|
||||
PythonManager::ThreadHolder threadHolder;
|
||||
|
||||
if (!cutterJupyterModule) {
|
||||
cutterJupyterModule = QtResImport("cutter_jupyter");
|
||||
if (!cutterJupyterModule) {
|
||||
qWarning() << "Failed to load cutter_jupyter module. Make sure jupyter is installed.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PyObject *startFunc = PyObject_GetAttrString(cutterJupyterModule, "start_jupyter");
|
||||
@ -122,7 +126,6 @@ bool JupyterConnection::startJupyterNotebook()
|
||||
}
|
||||
|
||||
cutterNotebookAppInstance = PyObject_CallObject(startFunc, nullptr);
|
||||
Python()->saveThread();
|
||||
|
||||
return cutterNotebookAppInstance != nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user