MCPcopy Create free account
hub / github.com/ipython/ipython / wait_using_polling

Function wait_using_polling

IPython/terminal/pt_inputhooks/tk.py:74–84  ·  view source on GitHub ↗

Windows TK doesn't support 'createfilehandler'. So, run the TK eventloop and poll until input is ready.

()

Source from the content-addressed store, hash-verified

72 root.deletefilehandler(inputhook_context.fileno())
73
74 def wait_using_polling():
75 """
76 Windows TK doesn't support 'createfilehandler'.
77 So, run the TK eventloop and poll until input is ready.
78 """
79 while not inputhook_context.input_is_ready():
80 while root.dooneevent(_tkinter.ALL_EVENTS | _tkinter.DONT_WAIT):
81 pass
82 # Sleep to make the CPU idle, but not too long, so that the UI
83 # stays responsive.
84 time.sleep(.01)
85
86 if root is not None:
87 if hasattr(root, 'createfilehandler'):

Callers 1

inputhookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected