Mercurial > cpython-lru_cache-weakref
diff Lib/idlelib/FileList.py @ 43257:a4bd8a4805a8
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
| author | Kurt B. Kaiser <kbk@shore.net> |
|---|---|
| date | Thu, 06 Sep 2007 04:03:04 +0000 |
| parents | 2ec16b6b4d04 |
| children | 3e5edf19d5f0 |
line wrap: on
line diff
--- a/Lib/idlelib/FileList.py Thu Sep 06 03:57:23 2007 +0000 +++ b/Lib/idlelib/FileList.py Thu Sep 06 04:03:04 2007 +0000 @@ -33,7 +33,12 @@ # 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)
