diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2013-08-04 19:39:32 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2013-08-04 19:39:32 (GMT) |
commit | ec53111f76ecba0dacb1a66acca465481303a524 (patch) | |
tree | 6255342788e83b2a9517f7956cc61ce5c5738b10 /Lib/idlelib/EditorWindow.py | |
parent | 44473f26deaa7c524a674f5e3a68a34d30488166 (diff) | |
parent | 95f34ab95959fa67d258043622744dae8519c5b2 (diff) | |
download | cpython-ec53111f76ecba0dacb1a66acca465481303a524.zip cpython-ec53111f76ecba0dacb1a66acca465481303a524.tar.gz cpython-ec53111f76ecba0dacb1a66acca465481303a524.tar.bz2 |
Merge with 3.3
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 18adb84..eaf68cb 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -882,12 +882,9 @@ class EditorWindow(object): "Load and update the recent files list and menus" rf_list = [] if os.path.exists(self.recent_files_path): - rf_list_file = open(self.recent_files_path,'r', - encoding='utf_8', errors='replace') - try: + with open(self.recent_files_path, 'r', + encoding='utf_8', errors='replace') as rf_list_file: rf_list = rf_list_file.readlines() - finally: - rf_list_file.close() if new_file: new_file = os.path.abspath(new_file) + '\n' if new_file in rf_list: |