Show More
@@ -716,6 +716,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
716 | # This hook runs with each cycle of the `prompt_toolkit`'s event loop. |
|
716 | # This hook runs with each cycle of the `prompt_toolkit`'s event loop. | |
717 | self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui) |
|
717 | self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui) | |
718 | else: |
|
718 | else: | |
|
719 | print(f'Disconnecting event loop {self._inputhook=}') | |||
719 | self.active_eventloop = self._inputhook = None |
|
720 | self.active_eventloop = self._inputhook = None | |
720 |
|
721 | |||
721 | # For prompt_toolkit 3.0. We have to create an asyncio event loop with |
|
722 | # For prompt_toolkit 3.0. We have to create an asyncio event loop with |
@@ -21,6 +21,9 b' def _reclaim_excepthook():' | |||||
21 | sys.excepthook = shell.excepthook |
|
21 | sys.excepthook = shell.excepthook | |
22 |
|
22 | |||
23 |
|
23 | |||
|
24 | announced = 0 | |||
|
25 | ||||
|
26 | ||||
24 | def inputhook(context): |
|
27 | def inputhook(context): | |
25 | global _appref |
|
28 | global _appref | |
26 | app = QtCore.QCoreApplication.instance() |
|
29 | app = QtCore.QCoreApplication.instance() | |
@@ -57,7 +60,14 b' def inputhook(context):' | |||||
57 | QtCore.QTimer.singleShot(0, _reclaim_excepthook) |
|
60 | QtCore.QTimer.singleShot(0, _reclaim_excepthook) | |
58 |
|
61 | |||
59 | event_loop = QtCore.QEventLoop(app) |
|
62 | event_loop = QtCore.QEventLoop(app) | |
60 | print(f'`inputhook` running Qt {QtCore.qVersion()} event loop.\r') |
|
63 | global announced | |
|
64 | if announced == 0: | |||
|
65 | print(f'`inputhook` running Qt {QtCore.qVersion()} event loop.\r') | |||
|
66 | announced += 1 | |||
|
67 | elif announced == 10: | |||
|
68 | announced = 0 | |||
|
69 | else: | |||
|
70 | announced += 1 | |||
61 | if sys.platform == 'win32': |
|
71 | if sys.platform == 'win32': | |
62 | # The QSocketNotifier method doesn't appear to work on Windows. |
|
72 | # The QSocketNotifier method doesn't appear to work on Windows. | |
63 | # Use polling instead. |
|
73 | # Use polling instead. |
General Comments 0
You need to be logged in to leave comments.
Login now