Skip to content

Commit d731f2e

Browse files
Take asynccontextmanager from contextlib now that we dropped Python 3.6.
1 parent 51944f1 commit d731f2e

File tree

3 files changed

+2
-139
lines changed

3 files changed

+2
-139
lines changed

src/prompt_toolkit/application/run_in_terminal.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
"""
44
import sys
55
from asyncio import Future, ensure_future
6+
from contextlib import asynccontextmanager
67
from typing import AsyncGenerator, Awaitable, Callable, TypeVar
78

89
from prompt_toolkit.eventloop import run_in_executor_with_context
910

1011
from .current import get_app_or_none
1112

12-
if sys.version_info >= (3, 7):
13-
from contextlib import asynccontextmanager
14-
else:
15-
from prompt_toolkit.eventloop.async_context_manager import asynccontextmanager
16-
17-
1813
__all__ = [
1914
"run_in_terminal",
2015
"in_terminal",

src/prompt_toolkit/eventloop/async_context_manager.py

Lines changed: 0 additions & 132 deletions
This file was deleted.

src/prompt_toolkit/eventloop/async_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Implementation for async generators.
33
"""
44
from asyncio import get_running_loop
5+
from contextlib import asynccontextmanager
56
from queue import Empty, Full, Queue
67
from typing import Any, AsyncGenerator, Callable, Iterable, TypeVar, Union
78

8-
from .async_context_manager import asynccontextmanager
99
from .utils import run_in_executor_with_context
1010

1111
__all__ = [

0 commit comments

Comments
 (0)