summaryrefslogtreecommitdiff
path: root/Lib/idlelib/run.py
diff options
context:
space:
mode:
authorMartin v. L?wis <martin@v.loewis.de>2012-07-09 20:53:03 +0200
committerMartin v. L?wis <martin@v.loewis.de>2012-07-09 20:53:03 +0200
commitf150341244cbb2b17f6a441652b7659c4ca7af0b (patch)
tree9153f1e971fed64b780c1ff133f020752b912f29 /Lib/idlelib/run.py
parent938eeed8cedfc32d5fa284787858ffd5763419d3 (diff)
parent36427a6f14b12701bbe49337efb980e6cc4f4b86 (diff)
downloadcpython-f150341244cbb2b17f6a441652b7659c4ca7af0b.tar.gz
merge 3.2
Diffstat (limited to 'Lib/idlelib/run.py')
-rw-r--r--Lib/idlelib/run.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 5c9c38197a..e4b9279ee0 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -7,6 +7,7 @@ import traceback
import _thread as thread
import threading
import queue
+import tkinter
from idlelib import CallTips
from idlelib import AutoComplete
@@ -39,6 +40,17 @@ else:
return s
warnings.formatwarning = idle_formatwarning_subproc
+
+tcl = tkinter.Tcl()
+
+
+def handle_tk_events(tcl=tcl):
+ """Process any tk events that are ready to be dispatched if tkinter
+ has been imported, a tcl interpreter has been created and tk has been
+ loaded."""
+ tcl.eval("update")
+
+
# Thread shared globals: Establish a queue between a subthread (which handles
# the socket) and the main thread (which runs user code), plus global
# completion, exit and interruptable (the main thread) flags:
@@ -94,6 +106,7 @@ def main(del_exitfunc=False):
try:
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
except queue.Empty:
+ handle_tk_events()
continue
method, args, kwargs = request
ret = method(*args, **kwargs)
@@ -272,6 +285,7 @@ class MyHandler(rpc.RPCHandler):
sys.stdin = self.console = _RPCFile(self.get_remote_proxy("stdin"))
sys.stdout = _RPCFile(self.get_remote_proxy("stdout"))
sys.stderr = _RPCFile(self.get_remote_proxy("stderr"))
+ sys.displayhook = rpc.displayhook
# page help() text to shell.
import pydoc # import must be done here to capture i/o binding
pydoc.pager = pydoc.plainpager