-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove compatibility codes for Python 3.10 or lower
- Loading branch information
Showing
9 changed files
with
43 additions
and
826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
import asyncio | ||
|
||
|
||
if hasattr(asyncio, 'get_running_loop'): | ||
get_running_loop = asyncio.get_running_loop | ||
else: | ||
get_running_loop = asyncio.get_event_loop | ||
|
||
|
||
if hasattr(asyncio, 'all_tasks'): | ||
all_tasks = asyncio.all_tasks | ||
else: | ||
all_tasks = asyncio.Task.all_tasks # type: ignore | ||
|
||
|
||
if hasattr(asyncio, 'current_task'): | ||
current_task = asyncio.current_task | ||
else: | ||
current_task = asyncio.Task.current_task # type: ignore | ||
get_running_loop = asyncio.get_running_loop | ||
all_tasks = asyncio.all_tasks | ||
current_task = asyncio.current_task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,12 @@ | ||
import asyncio | ||
from .base import TaskGroup, TaskGroupError, current_taskgroup | ||
from .persistent import PersistentTaskGroup, current_ptaskgroup | ||
from .types import MultiError | ||
|
||
from .types import MultiError, TaskGroupError | ||
|
||
if hasattr(asyncio, 'TaskGroup'): | ||
from . import persistent | ||
from .base import * # noqa | ||
from .persistent import * # noqa | ||
__all__ = [ | ||
"MultiError", | ||
"TaskGroup", | ||
"TaskGroupError", | ||
"current_taskgroup", | ||
*persistent.__all__, | ||
] | ||
else: | ||
from . import persistent_compat | ||
from .base_compat import * # type: ignore # noqa | ||
from .persistent_compat import * # type: ignore # noqa | ||
from .base_compat import has_contextvars | ||
__all__ = [ # type: ignore # noqa | ||
"MultiError", | ||
"TaskGroup", | ||
"TaskGroupError", | ||
*persistent_compat.__all__, | ||
] | ||
if has_contextvars: | ||
__all__.append("current_taskgroup") | ||
__all__ = ( | ||
"MultiError", | ||
"TaskGroup", | ||
"TaskGroupError", | ||
"current_taskgroup", | ||
"PersistentTaskGroup", | ||
"current_ptaskgroup", | ||
) |
Oops, something went wrong.