From 9fc84b82417912c55c44494b90946a4a9eee5c14 Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Sun, 28 Oct 2018 17:12:12 -0400 Subject: [PATCH] accept EOF as valid reason to end --- comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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':