diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2013-06-08 04:22:45 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2013-06-08 04:22:45 (GMT) |
commit | ba6c0d3b08768b1a6b9bebba5eeead840fdc9356 (patch) | |
tree | 43af5a771d5a7db76050f041c804d85fe93e08cf /Lib/idlelib/PyShell.py | |
parent | 50793b44382e8d2bdd3a89a0c1ecd8eb97093e22 (diff) | |
download | cpython-ba6c0d3b08768b1a6b9bebba5eeead840fdc9356.zip cpython-ba6c0d3b08768b1a6b9bebba5eeead840fdc9356.tar.gz cpython-ba6c0d3b08768b1a6b9bebba5eeead840fdc9356.tar.bz2 |
#18151, part 1: Backport idlelilb portion of Andrew Svetlov's 3.4 patch
changing IOError to OSError (#16715).
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r-- | Lib/idlelib/PyShell.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 34882a6..e9cef9b 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -59,7 +59,7 @@ else: try: file.write(warnings.formatwarning(message, category, filename, lineno, line=line)) - except IOError: + except OSError: pass ## file (probably __stderr__) is invalid, warning dropped. warnings.showwarning = idle_showwarning def idle_formatwarning(message, category, filename, lineno, line=None): @@ -213,7 +213,7 @@ class PyShellEditorWindow(EditorWindow): try: with open(self.breakpointPath, "r") as fp: lines = fp.readlines() - except IOError: + except OSError: lines = [] try: with open(self.breakpointPath, "w") as new_file: @@ -224,7 +224,7 @@ class PyShellEditorWindow(EditorWindow): breaks = self.breakpoints if breaks: new_file.write(filename + '=' + str(breaks) + '\n') - except IOError as err: + except OSError as err: if not getattr(self.root, "breakpoint_error_displayed", False): self.root.breakpoint_error_displayed = True tkMessageBox.showerror(title='IDLE Error', @@ -532,7 +532,7 @@ class ModifiedInterpreter(InteractiveInterpreter): return try: response = clt.pollresponse(self.active_seq, wait=0.05) - except (EOFError, IOError, KeyboardInterrupt): + except (EOFError, OSError, KeyboardInterrupt): # lost connection or subprocess terminated itself, restart # [the KBI is from rpc.SocketIO.handle_EOF()] if self.tkconsole.closing: |