Skip to content

Commit d209217

Browse files
committed
Upgrade Python syntax with pyupgrade --py37-plus
1 parent 05d0b99 commit d209217

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/prompt_toolkit/application/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ async def run_async(
655655
# See: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1553
656656
handle_sigint = False
657657

658-
async def _run_async(f: "asyncio.Future[_AppResult]") -> _AppResult:
658+
async def _run_async(f: asyncio.Future[_AppResult]) -> _AppResult:
659659
context = contextvars.copy_context()
660660
self.context = context
661661

src/prompt_toolkit/auto_suggest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_suggestion(self, buffer: Buffer, document: Document) -> Suggestion | Non
7272
"""
7373

7474
async def get_suggestion_async(
75-
self, buff: "Buffer", document: Document
75+
self, buff: Buffer, document: Document
7676
) -> Suggestion | None:
7777
"""
7878
Return a :class:`.Future` which is set when the suggestions are ready.
@@ -96,7 +96,7 @@ def get_suggestion(self, buff: Buffer, document: Document) -> Suggestion | None:
9696
return self.auto_suggest.get_suggestion(buff, document)
9797

9898
async def get_suggestion_async(
99-
self, buff: "Buffer", document: Document
99+
self, buff: Buffer, document: Document
100100
) -> Suggestion | None:
101101
"""
102102
Run the `get_suggestion` function in a thread.
@@ -170,7 +170,7 @@ def get_suggestion(self, buff: Buffer, document: Document) -> Suggestion | None:
170170
return auto_suggest.get_suggestion(buff, document)
171171

172172
async def get_suggestion_async(
173-
self, buff: "Buffer", document: Document
173+
self, buff: Buffer, document: Document
174174
) -> Suggestion | None:
175175
auto_suggest = self.get_auto_suggest() or DummyAutoSuggest()
176176
return await auto_suggest.get_suggestion_async(buff, document)

src/prompt_toolkit/layout/menus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def __init__(self, min_rows: int = 3, suggested_max_column_width: int = 30) -> N
332332
# the count, because a completer can add new completions to the
333333
# `CompletionState` while loading.)
334334
self._column_width_for_completion_state: WeakKeyDictionary[
335-
CompletionState, Tuple[int, int]
335+
CompletionState, tuple[int, int]
336336
] = WeakKeyDictionary()
337337

338338
# Info of last rendering.

0 commit comments

Comments
 (0)