diff --git a/ptpython/printer.py b/ptpython/printer.py index 3618934..85bd9c8 100644 --- a/ptpython/printer.py +++ b/ptpython/printer.py @@ -155,7 +155,7 @@ def _format_result_output( ) yield from formatted_result_repr return - except KeyboardInterrupt: + except (GeneratorExit, KeyboardInterrupt): raise # Don't catch here. except: # For bad code, `__getattr__` can raise something that's not an