aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/prompt-toolkit/py3/prompt_toolkit/application
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2025-02-04 23:55:58 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2025-02-05 00:13:10 +0300
commite0149bcce6c022b2baaf22dc46dfad00080d041d (patch)
tree8d8629279ddbec4d3cbd1756cd1348c7c1d53706 /contrib/python/prompt-toolkit/py3/prompt_toolkit/application
parent850bc4677d9c730e49444ba0fba91309d9cadd0b (diff)
downloadydb-e0149bcce6c022b2baaf22dc46dfad00080d041d.tar.gz
Intermediate changes
commit_hash:fe9cb645107d4e98cea6850ff89242dd287facbb
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/application')
-rw-r--r--contrib/python/prompt-toolkit/py3/prompt_toolkit/application/current.py4
-rw-r--r--contrib/python/prompt-toolkit/py3/prompt_toolkit/application/run_in_terminal.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/current.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/current.py
index 7e2cf480ba..3f7eb4bd46 100644
--- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/current.py
+++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/current.py
@@ -143,8 +143,8 @@ def create_app_session(
"""
Create a separate AppSession.
- This is useful if there can be multiple individual `AppSession`s going on.
- Like in the case of an Telnet/SSH server.
+ This is useful if there can be multiple individual ``AppSession``'s going
+ on. Like in the case of a Telnet/SSH server.
"""
# If no input/output is specified, fall back to the current input/output,
# if there was one that was set/created for the current session.
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/run_in_terminal.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/run_in_terminal.py
index 18a3dadeb9..1f5e18ea78 100644
--- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/run_in_terminal.py
+++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/run_in_terminal.py
@@ -111,4 +111,7 @@ async def in_terminal(render_cli_done: bool = False) -> AsyncGenerator[None, Non
app._request_absolute_cursor_position()
app._redraw()
finally:
- new_run_in_terminal_f.set_result(None)
+ # (Check for `.done()`, because it can be that this future was
+ # cancelled.)
+ if not new_run_in_terminal_f.done():
+ new_run_in_terminal_f.set_result(None)