Skip to content

Commit 6695f11

Browse files
committed
qtvcp: fix undefined name in gcode_editor Qsci import fallback
The PyQt5 branch of the QScintilla import fallback caught ImportError without binding it (no 'as e') but then passed exc_info=e to LOG.critical, raising NameError. Because sys.excepthook is installed at qtvcp startup and pops a modal error dialog, that NameError turns a missing python3-pyqt5.qsci into an indefinite hang (the dialog blocks forever under headless/CI) instead of a clean exit. Bind the exception as e and sys.exit(1), matching the PyQt6 branch below.
1 parent 77e9f58 commit 6695f11

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/python/qtvcp/widgets/gcode_editor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@
6262
if qtpy.PYQT5:
6363
try:
6464
from PyQt5.Qsci import QsciScintilla, QsciLexerCustom, QsciLexerPython
65-
except ImportError:
65+
except ImportError as e:
6666
LOG.critical("Can't import QsciScintilla - is package python3-pyqt5.qsci installed?", exc_info=e)
67+
sys.exit(1)
6768
else:
6869
try:
6970
from PyQt6.Qsci import QsciScintilla, QsciLexerCustom, QsciLexerPython

0 commit comments

Comments
 (0)