[Python-checkins] cpython (2.7): Issue #23184: idlelib, remove more unused names and imports.
terry.reedy
python-checkins at python.org
Sat May 16 05:04:21 CEST 2015
https://hg.python.org/cpython/rev/d50d661a08f5
changeset: 96069:d50d661a08f5
branch: 2.7
parent: 96063:81c3a75e0307
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Fri May 15 23:03:11 2015 -0400
summary:
Issue #23184: idlelib, remove more unused names and imports.
files:
Lib/idlelib/EditorWindow.py | 2 --
Lib/idlelib/PyShell.py | 19 ++++++++-----------
Lib/idlelib/RemoteDebugger.py | 2 +-
Lib/idlelib/macosxSupport.py | 4 +---
Lib/idlelib/run.py | 1 -
5 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -9,7 +9,6 @@
import webbrowser
from idlelib.MultiCall import MultiCallCreator
-from idlelib import idlever
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
@@ -154,7 +153,6 @@
EditorWindow.help_url = 'file://' + EditorWindow.help_url
else:
EditorWindow.help_url = "https://docs.python.org/%d.%d/" % sys.version_info[:2]
- currentTheme=idleConf.CurrentTheme()
self.flist = flist
root = root or flist.root
self.root = root
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -10,8 +10,6 @@
import socket
import time
import threading
-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
@@ -171,7 +168,7 @@
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 @@
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 @@
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 @@
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 @@
# 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 @@
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 @@
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 @@
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")
diff --git a/Lib/idlelib/RemoteDebugger.py b/Lib/idlelib/RemoteDebugger.py
--- a/Lib/idlelib/RemoteDebugger.py
+++ b/Lib/idlelib/RemoteDebugger.py
@@ -100,7 +100,7 @@
tb = tracebacktable[tbid]
stack, i = self.idb.get_stack(frame, tb)
##print >>sys.__stderr__, "get_stack() ->", stack
- stack = [(wrap_frame(frame), k) for frame, k in stack]
+ stack = [(wrap_frame(frame2), k) for frame2, k in stack]
##print >>sys.__stderr__, "get_stack() ->", stack
return stack, i
diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py
--- a/Lib/idlelib/macosxSupport.py
+++ b/Lib/idlelib/macosxSupport.py
@@ -125,11 +125,9 @@
#
# Due to a (mis-)feature of TkAqua the user will also see an empty Help
# menu.
- from Tkinter import Menu, Text, Text
- from idlelib.EditorWindow import prepstr, get_accelerator
+ from Tkinter import Menu
from idlelib import Bindings
from idlelib import WindowList
- from idlelib.MultiCall import MultiCallCreator
closeItem = Bindings.menudefs[0][1][-2]
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -1,5 +1,4 @@
import sys
-import io
import linecache
import time
import socket
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list