diff --git a/scripting/kicad_pyshell/kicad_pyeditor.py b/scripting/kicad_pyshell/kicad_pyeditor.py index 4f955ebf5f..93c572eb39 100644 --- a/scripting/kicad_pyshell/kicad_pyeditor.py +++ b/scripting/kicad_pyshell/kicad_pyeditor.py @@ -923,7 +923,12 @@ class KiCadEditorNotebookFrame(KiCadEditorFrame): place the stdout into the editor window """ import pydoc, sys self._keep_stdin = sys.stdin - pydoc.pager = pydoc.plainpager + + """getline will crash unexpectedly, so we don't support it + and bold fonts wreak havoc on our output, so strip them as well""" + pydoc.getpager = lambda: pydoc.plainpager + pydoc.Helper.getline = lambda self, prompt: None + pydoc.TextDoc.use_bold = lambda self, text: text dispatcher.connect(receiver=self._editorChange, signal='EditorChange', sender=self.notebook) diff --git a/scripting/kipython_frame.cpp b/scripting/kipython_frame.cpp index acc1b89add..abb5ebb84d 100644 --- a/scripting/kipython_frame.cpp +++ b/scripting/kipython_frame.cpp @@ -83,8 +83,6 @@ KIPYTHON_FRAME::KIPYTHON_FRAME( KIWAY* aKiway, wxWindow* aParent ) : KIWAY_PLAYER( aKiway, aParent, FRAME_PYTHON, wxT( "KiPython" ), wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, wxT( "KiPython" ) ) { - m_stdio = 0; - CallAfter( [&](){ SetupPythonEditor(); } ); redirectStdio(); @@ -93,8 +91,4 @@ KIPYTHON_FRAME::KIPYTHON_FRAME( KIWAY* aKiway, wxWindow* aParent ) : KIPYTHON_FRAME::~KIPYTHON_FRAME() { - wxWindow* stdio_window = wxWindow::FindWindowById( m_stdio ); - - if( stdio_window ) - stdio_window->Close( true ); } diff --git a/scripting/kipython_frame.h b/scripting/kipython_frame.h index 4bb8fc8d67..f2cf2a8d94 100644 --- a/scripting/kipython_frame.h +++ b/scripting/kipython_frame.h @@ -55,7 +55,6 @@ private: bool canCloseWindow( wxCloseEvent& aCloseEvent ) override { return true; } void doCloseWindow() override {} - long m_stdio; };