diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-07-02 01:33:26 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-07-02 01:33:26 (GMT) |
commit | 228b99e8a40554f75ba631e8daf42f7fb625bd0c (patch) | |
tree | 5890b549200397c06e810e707928eb643719671c /Lib/idlelib | |
parent | 9bc505616b4bc88b29993f351218c3083bd3f3e8 (diff) | |
download | cpython-228b99e8a40554f75ba631e8daf42f7fb625bd0c.zip cpython-228b99e8a40554f75ba631e8daf42f7fb625bd0c.tar.gz cpython-228b99e8a40554f75ba631e8daf42f7fb625bd0c.tar.bz2 |
More idlelib cleanup inspired by pyflakes.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/SearchEngine.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/StackViewer.py | 4 | ||||
-rw-r--r-- | Lib/idlelib/idle_test/test_textview.py | 6 |
3 files changed, 5 insertions, 7 deletions
diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/SearchEngine.py index b3b7b4d..2118cd3 100644 --- a/Lib/idlelib/SearchEngine.py +++ b/Lib/idlelib/SearchEngine.py @@ -85,7 +85,7 @@ class SearchEngine: except re.error as what: args = what.args msg = args[0] - col = arg[1] if len(args) >= 2 else -1 + col = args[1] if len(args) >= 2 else -1 self.report_error(pat, msg, col) return None return prog diff --git a/Lib/idlelib/StackViewer.py b/Lib/idlelib/StackViewer.py index 74c9136..ccf6283 100644 --- a/Lib/idlelib/StackViewer.py +++ b/Lib/idlelib/StackViewer.py @@ -131,8 +131,8 @@ def _stack_viewer(parent): root.geometry("+%d+%d"%(x, y + 150)) flist = PyShellFileList(root) try: # to obtain a traceback object - a - except: + intentional_name_error + except NameError: exc_type, exc_value, exc_tb = sys.exc_info() # inject stack trace to sys diff --git a/Lib/idlelib/idle_test/test_textview.py b/Lib/idlelib/idle_test/test_textview.py index 9b25ecd..0e81b63 100644 --- a/Lib/idlelib/idle_test/test_textview.py +++ b/Lib/idlelib/idle_test/test_textview.py @@ -3,7 +3,7 @@ import unittest import os from test.test_support import requires -from Tkinter import Tk, Text, TclError +from Tkinter import Tk from idlelib import textView as tv from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Mbox @@ -93,6 +93,4 @@ class textviewTest(unittest.TestCase): self.assertIsNone(view) if __name__ == '__main__': - unittest.main(verbosity=2, exit=False) - from idlelib.idle_test.htest import run - run(TextViewer) + unittest.main(verbosity=2) |