aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-06 18:18:01 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-06 18:18:01 +0300
commit01fbacb386809436dfa331780875aed72cb76118 (patch)
tree04c911ad96ff0523bd4d3e7a45c23cf2f2d7607d /contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py
parent48fb997d7f820a474b9094a72d9798a95ec612b7 (diff)
downloadydb-01fbacb386809436dfa331780875aed72cb76118.tar.gz
intermediate changes
ref:b4f892f3c2b06a356c155f73c27efc5661a7fb89
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py')
-rw-r--r--contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py
index a8d8a58555..4dc1b18d1c 100644
--- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py
+++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/shortcuts/prompt.py
@@ -900,6 +900,7 @@ class PromptSession(Generic[_T]):
accept_default: bool = False,
pre_run: Optional[Callable[[], None]] = None,
set_exception_handler: bool = True,
+ handle_sigint: bool = True,
in_thread: bool = False,
) -> _T:
"""
@@ -1028,10 +1029,12 @@ class PromptSession(Generic[_T]):
# dumb prompt.
if self._output is None and is_dumb_terminal():
with self._dumb_prompt(self.message) as dump_app:
- return dump_app.run(in_thread=in_thread)
+ return dump_app.run(in_thread=in_thread, handle_sigint=handle_sigint)
return self.app.run(
- set_exception_handler=set_exception_handler, in_thread=in_thread
+ set_exception_handler=set_exception_handler,
+ in_thread=in_thread,
+ handle_sigint=handle_sigint,
)
@contextmanager
@@ -1132,6 +1135,7 @@ class PromptSession(Generic[_T]):
accept_default: bool = False,
pre_run: Optional[Callable[[], None]] = None,
set_exception_handler: bool = True,
+ handle_sigint: bool = True,
) -> _T:
if message is not None:
@@ -1219,9 +1223,11 @@ class PromptSession(Generic[_T]):
# dumb prompt.
if self._output is None and is_dumb_terminal():
with self._dumb_prompt(self.message) as dump_app:
- return await dump_app.run_async()
+ return await dump_app.run_async(handle_sigint=handle_sigint)
- return await self.app.run_async(set_exception_handler=set_exception_handler)
+ return await self.app.run_async(
+ set_exception_handler=set_exception_handler, handle_sigint=handle_sigint
+ )
def _add_pre_run_callables(
self, pre_run: Optional[Callable[[], None]], accept_default: bool