diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-11-30 19:18:46 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-11-30 19:18:46 (GMT) |
commit | 6453c1f218b53c4c68faa37cb15db81357c5e5dc (patch) | |
tree | 6b197b7e43e09464d504c7fa97b90c6124b97461 /Lib | |
parent | 539594f2f5a65e0738d6042a273b0e42ed7a1088 (diff) | |
download | cpython-6453c1f218b53c4c68faa37cb15db81357c5e5dc.zip cpython-6453c1f218b53c4c68faa37cb15db81357c5e5dc.tar.gz cpython-6453c1f218b53c4c68faa37cb15db81357c5e5dc.tar.bz2 |
Cleanup:
* Remove unused imports
* Convert some more 1/0 to True/False
* Shorten up a long line
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/ScriptBinding.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py index c24bf81..4a42576 100644 --- a/Lib/idlelib/ScriptBinding.py +++ b/Lib/idlelib/ScriptBinding.py @@ -17,9 +17,6 @@ XXX Redesign this interface (yet again) as follows: """ -import sys -import os -import imp import tkMessageBox indent_message = """Error: Inconsistent indentation detected! @@ -69,15 +66,14 @@ class ScriptBinding: try: tabnanny.process_tokens(tokenize.generate_tokens(f.readline)) except tokenize.TokenError, msg: - self.errorbox("Token error", - "Token error:\n%s" % str(msg)) - return 0 + self.errorbox("Token error", "Token error:\n%s" % msg) + return False except tabnanny.NannyNag, nag: # The error messages from tabnanny are too confusing... self.editwin.gotoline(nag.get_lineno()) self.errorbox("Tab/space error", indent_message) - return 0 - return 1 + return False + return True def checksyntax(self, filename): f = open(filename, 'r') @@ -103,7 +99,7 @@ class ScriptBinding: self.editwin.gotoline(lineno) self.errorbox("Syntax error", "There's an error in your program:\n" + msg) - return 1 + return True def run_script_event(self, event): filename = self.getfilename() |