From ffed6d35e3f66cad67c3b7b983311fbac0200848 Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Thu, 25 Oct 2018 15:07:55 -0400 Subject: [PATCH] only import readline module when starting interactive prompt --- comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comment.py b/comment.py index bf2ac6a..9cb7d7e 100755 --- a/comment.py +++ b/comment.py @@ -18,7 +18,6 @@ __status__ = "Prototype" import antlr4 import configparser import logging -import readline import sys from CommentMacroLexer import CommentMacroLexer @@ -62,6 +61,7 @@ if __name__ == '__main__': logger.debug("found macro at argv[1]") comment(sys.argv[1]) else: + import readline # for input history and line editing while True: try: text = input("comment# ")