cpython: 89878808f4ce (original) (raw)

Mercurial > cpython

changeset 75921:89878808f4ce

Issue #14200 — now displayhook for IDLE works in non-subprocess mode as well as subprecess. [#14200]

Andrew Svetlov andrew.svetlov@gmail.com
date Sun, 25 Mar 2012 11:43:02 +0300
parents 43f6a1078d67
children 7d8339083cb3
files Lib/idlelib/PyShell.py Lib/idlelib/rpc.py Lib/idlelib/run.py
diffstat 3 files changed, 22 insertions(+), 21 deletions(-)[+] [-] Lib/idlelib/PyShell.py 2 Lib/idlelib/rpc.py 19 Lib/idlelib/run.py 22

line wrap: on

line diff

--- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -999,6 +999,8 @@ class PyShell(OutputWindow): return False else: nosub = "==== No Subprocess ===="

+ self.write("Python %s on %s\n%s\n%s" % (sys.version, sys.platform, self.COPYRIGHT, nosub)) self.showprompt()

--- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -40,6 +40,7 @@ import traceback import copyreg import types import marshal +import builtins def unpickle_code(ms): @@ -603,3 +604,21 @@ class MethodProxy(object):

XXX KBK 09Sep03 We need a proper unit test for this module. Previously

existing test code was removed at Rev 1.27 (r34098).

+ +def displayhook(value):

--- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -6,7 +6,6 @@ import traceback import _thread as thread import threading import queue -import builtins from idlelib import CallTips from idlelib import AutoComplete @@ -262,25 +261,6 @@ class MyRPCServer(rpc.RPCServer): thread.interrupt_main() -def displayhook(value):

- - class MyHandler(rpc.RPCHandler): def handle(self): @@ -290,7 +270,7 @@ class MyHandler(rpc.RPCHandler): sys.stdin = self.console = self.get_remote_proxy("stdin") sys.stdout = self.get_remote_proxy("stdout") sys.stderr = self.get_remote_proxy("stderr")