summaryrefslogtreecommitdiffstats
path: root/Lib/code.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-05-04 05:17:47 (GMT)
committerGitHub <noreply@github.com>2017-05-04 05:17:47 (GMT)
commit7e4db2f253c555568d56177c2fd083bcf8f88d34 (patch)
treeaa2606f09d5b1095bb20573ed6b0be38ca4d6f33 /Lib/code.py
parent1c4670ea0cc3d208121af11b9b973e6bb268e570 (diff)
downloadcpython-7e4db2f253c555568d56177c2fd083bcf8f88d34.zip
cpython-7e4db2f253c555568d56177c2fd083bcf8f88d34.tar.gz
cpython-7e4db2f253c555568d56177c2fd083bcf8f88d34.tar.bz2
bpo-30166: Import command-line parsing modules only when needed. (#1293)
Diffstat (limited to 'Lib/code.py')
-rw-r--r--Lib/code.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/code.py b/Lib/code.py
index 23295f4..d8106ae 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")