summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
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/idlelib
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/idlelib')
-rwxr-xr-xLib/idlelib/pyshell.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index 8ddc189..5b0e5b2 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -18,11 +18,10 @@ if TkVersion < 8.5:
raise SystemExit(1)
from code import InteractiveInterpreter
-import getopt
import linecache
import os
import os.path
-from platform import python_version, system
+from platform import python_version
import re
import socket
import subprocess
@@ -31,14 +30,12 @@ import time
import tokenize
import warnings
-from idlelib import testing # bool value
from idlelib.colorizer import ColorDelegator
from idlelib.config import idleConf
from idlelib import debugger
from idlelib import debugger_r
from idlelib.editor import EditorWindow, fixwordbreaks
from idlelib.filelist import FileList
-from idlelib import macosx
from idlelib.outwin import OutputWindow
from idlelib import rpc
from idlelib.run import idle_formatwarning, PseudoInputFile, PseudoOutputFile
@@ -1371,6 +1368,11 @@ echo "import sys; print(sys.argv)" | idle - "foobar"
"""
def main():
+ import getopt
+ from platform import system
+ from idlelib import testing # bool value
+ from idlelib import macosx
+
global flist, root, use_subprocess
capture_warnings(True)