Skip to content

Commit

Permalink
pyconsole: Fix crash on python3.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Jan 2, 2023
1 parent a7cd6cd commit 101b8c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/pyconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ bool CAPyConsole::cmdIntern(QString strCmd)
curObject = curObject->parent();
PyEval_RestoreThread(CASwigPython::mainThreadState);
argsPython << CASwigPython::toPythonObject(static_cast<CAMainWin*>(curObject)->document(), CASwigPython::Document);
PyEval_ReleaseThread(CASwigPython::mainThreadState);
argsPython << PyUnicode_FromString(strCmd.toStdString().c_str());
PyEval_ReleaseThread(CASwigPython::mainThreadState);

// Can't autoreload because we are using global objects in pycl2.py that would get overwritten.
auto ret = CASwigPython::callFunction(QFileInfo("scripts:pycl2.py").absoluteFilePath(), "main", argsPython, false);
Expand Down

0 comments on commit 101b8c2

Please sign in to comment.