From 105f60ee628842a20f70526f9e994bc8acfaa9c7 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Thu, 6 Sep 2007 04:03:04 +0000 Subject: 1. Fail gracefully if the file fails to decode when loaded. 2. If the load fails, close the half-built edit window. 3. Don't reopen the file to check the shebang. 4. Clarify that we're setting tabs in Tk. M EditorWindow.py M FileList.py --- Lib/idlelib/FileList.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Lib/idlelib/FileList.py') diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/FileList.py index 52b3eebfcf..2f5053fb71 100644 --- a/Lib/idlelib/FileList.py +++ b/Lib/idlelib/FileList.py @@ -33,7 +33,12 @@ class FileList: # Don't create window, perform 'action', e.g. open in same window return action(filename) else: - return self.EditorWindow(self, filename, key) + edit = self.EditorWindow(self, filename, key) + if edit.good_load: + return edit + else: + edit._close() + return None def gotofileline(self, filename, lineno=None): edit = self.open(filename) -- cgit v1.2.1