File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/prompt_toolkit/shortcuts/progress_bar Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 16
16
import signal
17
17
import threading
18
18
import traceback
19
- from asyncio import new_event_loop , set_event_loop
20
19
from typing import (
21
20
Callable ,
22
21
Generic ,
@@ -156,7 +155,6 @@ def keyboard_interrupt_to_main_thread() -> None:
156
155
157
156
self ._thread : threading .Thread | None = None
158
157
159
- self ._app_loop = new_event_loop ()
160
158
self ._has_sigwinch = False
161
159
self ._app_started = threading .Event ()
162
160
@@ -224,7 +222,6 @@ def width_for_formatter(formatter: Formatter) -> AnyDimension:
224
222
225
223
# Run application in different thread.
226
224
def run () -> None :
227
- set_event_loop (self ._app_loop )
228
225
try :
229
226
self .app .run (pre_run = self ._app_started .set )
230
227
except BaseException as e :
@@ -245,12 +242,11 @@ def __exit__(self, *a: object) -> None:
245
242
self ._app_started .wait ()
246
243
247
244
# Quit UI application.
248
- if self .app .is_running :
249
- self ._app_loop .call_soon_threadsafe (self .app .exit )
245
+ if self .app .is_running and self . app . loop is not None :
246
+ self .app . loop .call_soon_threadsafe (self .app .exit )
250
247
251
248
if self ._thread is not None :
252
249
self ._thread .join ()
253
- self ._app_loop .close ()
254
250
255
251
def __call__ (
256
252
self ,
You can’t perform that action at this time.
0 commit comments