diff --git a/comment.py b/comment.py index 054368c..0f4d650 100755 --- a/comment.py +++ b/comment.py @@ -65,7 +65,7 @@ if __name__ == '__main__': while True: try: text = input("comment# ") - except KeyboardInterrupt: + except (KeyboardInterrupt, EOFError): text = 'exit' print(text) if text == 'exit':