[Python-checkins] bpo-35202: Remove unused imports in idlelib (GH-10438)

Terry Jan Reedy webhook-mailer at python.org
Sat Nov 10 01:45:36 EST 2018

commit: 43a74abb3a87092a7fd6c71042eafb977d70d8e0
branch: master
author: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <thatiparthysreenivas at gmail.com>
committer: Terry Jan Reedy <tjreedy at udel.edu>
date: 2018-11-10T01:45:31-05:00

bpo-35202: Remove unused imports in idlelib (GH-10438)

A Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst
M Lib/idlelib/codecontext.py
M Lib/idlelib/filelist.py
M Lib/idlelib/idle_test/test_config.py
M Lib/idlelib/idle_test/test_config_key.py
M Lib/idlelib/idle_test/test_rpc.py
M Lib/idlelib/pyparse.py

diff --git a/Lib/idlelib/codecontext.py b/Lib/idlelib/codecontext.py
index 7c88a4d015e3..ef8852852d1f 100644
--- a/Lib/idlelib/codecontext.py
+++ b/Lib/idlelib/codecontext.py
@@ -13,7 +13,7 @@
 from sys import maxsize as INFINITY
 import tkinter
-from tkinter.constants import TOP, LEFT, X, W, SUNKEN
+from tkinter.constants import TOP, X, SUNKEN
 from idlelib.config import idleConf
diff --git a/Lib/idlelib/filelist.py b/Lib/idlelib/filelist.py
index 52628392e617..0d200854ef00 100644
--- a/Lib/idlelib/filelist.py
+++ b/Lib/idlelib/filelist.py
@@ -115,7 +115,6 @@ def _test():  # TODO check and convert to htest
     from tkinter import Tk
     from idlelib.editor import fixwordbreaks
     from idlelib.run import fix_scaling
-    import sys
     root = Tk()
diff --git a/Lib/idlelib/idle_test/test_config.py b/Lib/idlelib/idle_test/test_config.py
index 8c9197284e07..169d054efd08 100644
--- a/Lib/idlelib/idle_test/test_config.py
+++ b/Lib/idlelib/idle_test/test_config.py
@@ -4,7 +4,6 @@
 Much of IdleConf is also exercised by ConfigDialog and test_configdialog.
 from idlelib import config
-import copy
 import sys
 import os
 import tempfile
diff --git a/Lib/idlelib/idle_test/test_config_key.py b/Lib/idlelib/idle_test/test_config_key.py
index 08471666a452..5031daadee0a 100644
--- a/Lib/idlelib/idle_test/test_config_key.py
+++ b/Lib/idlelib/idle_test/test_config_key.py
@@ -2,7 +2,6 @@
 from idlelib import config_key
 from test.support import requires
-import sys
 import unittest
 from tkinter import Tk
 from idlelib.idle_test.mock_idle import Func
diff --git a/Lib/idlelib/idle_test/test_rpc.py b/Lib/idlelib/idle_test/test_rpc.py
index 48be65ba10b9..81eff398c72f 100644
--- a/Lib/idlelib/idle_test/test_rpc.py
+++ b/Lib/idlelib/idle_test/test_rpc.py
@@ -3,7 +3,6 @@
 from idlelib import rpc
 import unittest
-import marshal
 class CodePicklerTest(unittest.TestCase):
diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py
index 1eeb9154d906..81e7f539803c 100644
--- a/Lib/idlelib/pyparse.py
+++ b/Lib/idlelib/pyparse.py
@@ -11,7 +11,6 @@
 _chew_ordinaryre - non-special characters.
 import re
-import sys
 # Reason last statement is continued (or C_NONE if it's not).
diff --git a/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst
new file mode 100644
index 000000000000..1824536f3db1
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-11-10-09-10-54.bpo-35202.TeJJrt.rst
@@ -0,0 +1 @@
+Remove unused imports from lib/idlelib

More information about the Python-checkins mailing list