From d8dc7496c5fb1590654e29260cb09f43d6497a6a Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 14 May 2015 18:10:30 -0400 Subject: [PATCH] idlelib: remove unused names and imports (one is a duplicate import). --- Lib/idlelib/IOBinding.py | 7 +++---- Lib/idlelib/RemoteDebugger.py | 1 - Lib/idlelib/SearchDialog.py | 2 +- Lib/idlelib/TreeWidget.py | 2 +- Lib/idlelib/configDialog.py | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index e7d747c377..db6773f8a8 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -6,7 +6,6 @@ # which will only understand the local convention. import os -import types import pipes import sys import codecs @@ -391,7 +390,7 @@ class IOBinding: return False def encode(self, chars): - if isinstance(chars, types.StringType): + if isinstance(chars, str): # This is either plain ASCII, or Tk was returning mixed-encoding # text to us. Don't try to guess further. return chars @@ -568,7 +567,7 @@ class IOBinding: "Update recent file list on all editor windows" self.editwin.update_recent_files_list(filename) -def _io_binding(parent): +def _io_binding(parent): # htest # root = Tk() root.title("Test IOBinding") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) @@ -591,7 +590,7 @@ def _io_binding(parent): text.pack() text.focus_set() editwin = MyEditWin(text) - io = IOBinding(editwin) + IOBinding(editwin) if __name__ == "__main__": from idlelib.idle_test.htest import run diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/RemoteDebugger.py index 647285fe4e..88efc7c3b3 100644 --- a/Lib/idlelib/RemoteDebugger.py +++ b/Lib/idlelib/RemoteDebugger.py @@ -21,7 +21,6 @@ barrier, in particular frame and traceback objects. """ import types -from idlelib import rpc from idlelib import Debugger debugging = 0 diff --git a/Lib/idlelib/SearchDialog.py b/Lib/idlelib/SearchDialog.py index 2aadb8431f..043168af00 100644 --- a/Lib/idlelib/SearchDialog.py +++ b/Lib/idlelib/SearchDialog.py @@ -23,7 +23,7 @@ def find_selection(text): class SearchDialog(SearchDialogBase): def create_widgets(self): - f = SearchDialogBase.create_widgets(self) + SearchDialogBase.create_widgets(self) self.make_button("Find Next", self.default_command, 1) def default_command(self, event=None): diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py index 1e56e86b0c..88083f0f29 100644 --- a/Lib/idlelib/TreeWidget.py +++ b/Lib/idlelib/TreeWidget.py @@ -246,7 +246,7 @@ class TreeNode: else: self.edit_finish() try: - label = self.label + self.label except AttributeError: # padding carefully selected (on Windows) to match Entry widget: self.label = Label(self.canvas, text=text, bd=0, padx=2, pady=2) diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py index c416151d9d..41b76e80c8 100644 --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configDialog.py @@ -14,7 +14,6 @@ import tkMessageBox, tkColorChooser, tkFont from idlelib.configHandler import idleConf from idlelib.dynOptionMenuWidget import DynOptionMenu -from idlelib.tabbedpages import TabbedPageSet from idlelib.keybindingDialog import GetKeysDialog from idlelib.configSectionNameDialog import GetCfgSectionNameDialog from idlelib.configHelpSourceEdit import GetHelpSourceDialog -- 2.50.1