From 7e4db2f253c555568d56177c2fd083bcf8f88d34 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 4 May 2017 08:17:47 +0300 Subject: bpo-30166: Import command-line parsing modules only when needed. (#1293) --- Lib/code.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/code.py') diff --git a/Lib/code.py b/Lib/code.py index 23295f4cf5..d8106ae612 100644 --- a/Lib/code.py +++ b/Lib/code.py @@ -7,7 +7,6 @@ import sys import traceback -import argparse from codeop import CommandCompiler, compile_command __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", @@ -303,6 +302,8 @@ def interact(banner=None, readfunc=None, local=None, exitmsg=None): if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser() parser.add_argument('-q', action='store_true', help="don't print version and copyright messages") -- cgit v1.2.1