Issue #23184: idlelib, remove more unused names and imports.

This commit is contained in:
Terry Jan Reedy 2015-05-15 23:03:17 -04:00
parent 2733618fd9
commit 038c16b9a0
6 changed files with 10 additions and 20 deletions

View file

@ -10,8 +10,6 @@
import threading
import time
import tokenize
import traceback
import types
import io
import linecache
@ -32,7 +30,6 @@
from idlelib.UndoDelegator import UndoDelegator
from idlelib.OutputWindow import OutputWindow
from idlelib.configHandler import idleConf
from idlelib import idlever
from idlelib import rpc
from idlelib import Debugger
from idlelib import RemoteDebugger
@ -166,7 +163,7 @@ def set_breakpoint(self, lineno):
filename = self.io.filename
text.tag_add("BREAK", "%d.0" % lineno, "%d.0" % (lineno+1))
try:
i = self.breakpoints.index(lineno)
self.breakpoints.index(lineno)
except ValueError: # only add if missing, i.e. do once
self.breakpoints.append(lineno)
try: # update the subprocess debugger
@ -427,7 +424,7 @@ def start_subprocess(self):
try:
self.rpcclt = MyRPCClient(addr)
break
except OSError as err:
except OSError:
pass
else:
self.display_port_binding_error()
@ -448,7 +445,7 @@ def start_subprocess(self):
self.rpcclt.listening_sock.settimeout(10)
try:
self.rpcclt.accept()
except socket.timeout as err:
except socket.timeout:
self.display_no_subprocess_error()
return None
self.rpcclt.register("console", self.tkconsole)
@ -483,7 +480,7 @@ def restart_subprocess(self, with_cwd=False):
self.spawn_subprocess()
try:
self.rpcclt.accept()
except socket.timeout as err:
except socket.timeout:
self.display_no_subprocess_error()
return None
self.transfer_path(with_cwd=with_cwd)
@ -501,7 +498,7 @@ def restart_subprocess(self, with_cwd=False):
# restart subprocess debugger
if debug:
# Restarted debugger connects to current instance of debug GUI
gui = RemoteDebugger.restart_subprocess_debugger(self.rpcclt)
RemoteDebugger.restart_subprocess_debugger(self.rpcclt)
# reload remote debugger breakpoints for all PyShellEditWindows
debug.load_breakpoints()
self.compile.compiler.flags = self.original_compiler_flags
@ -1231,7 +1228,7 @@ def runit(self):
while i > 0 and line[i-1] in " \t":
i = i-1
line = line[:i]
more = self.interp.runsource(line)
self.interp.runsource(line)
def open_stack_viewer(self, event=None):
if self.interp.rpcclt:
@ -1245,7 +1242,7 @@ def open_stack_viewer(self, event=None):
master=self.text)
return
from idlelib.StackViewer import StackBrowser
sv = StackBrowser(self.root, self.flist)
StackBrowser(self.root, self.flist)
def view_restart_mark(self, event=None):
self.text.see("iomark")