From 7152d884d1df31fc42e674bc4c0a9b1de01c7d70 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Fri, 5 Oct 2012 22:12:44 +0300 Subject: Issue #16123: IDLE - deprecate running without a subprocess. Patch by Roger Serwy --- Lib/idlelib/PyShell.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Lib/idlelib/PyShell.py') diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 50d6182ab6..a2f1e866c6 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1008,7 +1008,10 @@ class PyShell(OutputWindow): self.close() return False else: - nosub = "==== No Subprocess ====" + nosub = ("==== No Subprocess ====\n\n" + + "WARNING: Running IDLE without a Subprocess is deprecated\n" + + "and will be removed in a later version. See Help/IDLE Help\n" + + "for details.\n\n") sys.displayhook = rpc.displayhook self.write("Python %s on %s\n%s\n%s" % @@ -1295,7 +1298,8 @@ USAGE: idle [-deins] [-t title] [file]* idle [-dns] [-t title] - [arg]* -h print this help message and exit - -n run IDLE without a subprocess (see Help/IDLE Help for details) + -n run IDLE without a subprocess (DEPRECATED, + see Help/IDLE Help for details) The following options will override the IDLE 'settings' configuration: @@ -1373,6 +1377,8 @@ def main(): if o == '-i': enable_shell = True if o == '-n': + print(" Warning: running IDLE without a subprocess is deprecated.", + file=sys.stderr) use_subprocess = False if o == '-r': script = a -- cgit v1.2.1 From 753312e42f39ef773870f1787eb67d09835e9204 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Fri, 5 Oct 2012 22:16:55 +0300 Subject: normalize whitespaces --- Lib/idlelib/PyShell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/idlelib/PyShell.py') diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index a2f1e866c6..142c924b95 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1009,7 +1009,7 @@ class PyShell(OutputWindow): return False else: nosub = ("==== No Subprocess ====\n\n" + - "WARNING: Running IDLE without a Subprocess is deprecated\n" + + "WARNING: Running IDLE without a Subprocess is deprecated\n" + "and will be removed in a later version. See Help/IDLE Help\n" + "for details.\n\n") sys.displayhook = rpc.displayhook -- cgit v1.2.1 From 9d4b88aabc07af29601775a537b476c959f5f11b Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 18 Dec 2012 23:10:48 +0200 Subject: Issue #16717: get rid of socket.error, replace with OSError --- Lib/idlelib/PyShell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/idlelib/PyShell.py') diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index bff52a9708..696d363ade 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -393,7 +393,7 @@ class ModifiedInterpreter(InteractiveInterpreter): try: self.rpcclt = MyRPCClient(addr) break - except socket.error as err: + except OSError as err: pass else: self.display_port_binding_error() -- cgit v1.2.1 From 45d1bc39881473d6fec76c4627070ac0b89d4b4c Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 25 Dec 2012 16:47:37 +0200 Subject: Replace IOError with OSError (#16715) --- Lib/idlelib/PyShell.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/idlelib/PyShell.py') diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 696d363ade..6a9ed325db 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -58,7 +58,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): @@ -211,7 +211,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: @@ -222,7 +222,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', @@ -528,7 +528,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: -- cgit v1.2.1