diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2015-05-16 03:03:11 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2015-05-16 03:03:11 (GMT) |
commit | 2848925ed252769d5fcc4ee1ba91a250810b1b55 (patch) | |
tree | 134f61614344af1f3895d2d9c51377a823c10fd0 /Lib/idlelib/PyShell.py | |
parent | f465e0f9296a1959c91c03a3663ba1e94ad9f1d3 (diff) | |
download | cpython-2848925ed252769d5fcc4ee1ba91a250810b1b55.zip cpython-2848925ed252769d5fcc4ee1ba91a250810b1b55.tar.gz cpython-2848925ed252769d5fcc4ee1ba91a250810b1b55.tar.bz2 |
Issue #23184: idlelib, remove more unused names and imports.
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rwxr-xr-x | Lib/idlelib/PyShell.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 79db883..17ca0ef 100755 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -10,8 +10,6 @@ import re import socket import time import threading -import traceback -import types import io import linecache @@ -32,7 +30,6 @@ from idlelib.ColorDelegator import ColorDelegator 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 @@ -171,7 +168,7 @@ class PyShellEditorWindow(EditorWindow): 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 @@ -439,7 +436,7 @@ class ModifiedInterpreter(InteractiveInterpreter): try: self.rpcclt = MyRPCClient(addr) break - except socket.error as err: + except socket.error: pass else: self.display_port_binding_error() @@ -460,7 +457,7 @@ class ModifiedInterpreter(InteractiveInterpreter): 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) @@ -495,7 +492,7 @@ class ModifiedInterpreter(InteractiveInterpreter): 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) @@ -513,7 +510,7 @@ class ModifiedInterpreter(InteractiveInterpreter): # 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 @@ -671,7 +668,7 @@ class ModifiedInterpreter(InteractiveInterpreter): self.more = 0 self.save_warnings_filters = warnings.filters[:] warnings.filterwarnings(action="error", category=SyntaxWarning) - if isinstance(source, types.UnicodeType): + if isinstance(source, unicode): from idlelib import IOBinding try: source = source.encode(IOBinding.encoding) @@ -1246,7 +1243,7 @@ class PyShell(OutputWindow): 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: @@ -1260,7 +1257,7 @@ class PyShell(OutputWindow): 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") |