Skip to content

Commit

Permalink
remove pointless TaskInfo.__reduce__ you cannot pickle a coroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed May 12, 2021
1 parent 9b14209 commit ebb72c3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/anyio/_core/_testing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Coroutine, Generator, Optional, Tuple, Type
from typing import Coroutine, Generator, Optional

from ._compat import DeprecatedAwaitableList, _warn_deprecation
from ._eventloop import get_asynclib
Expand Down Expand Up @@ -43,11 +43,6 @@ def __await__(self) -> Generator[None, None, "TaskInfo"]:
yield
return self

def __reduce__(self) -> Tuple[
Type["TaskInfo"], Tuple[int, Optional[int], Optional[str], Coroutine]
]:
return TaskInfo, (self.id, self.parent_id, self.name, self.coro)

def _unwrap(self) -> 'TaskInfo':
return self

Expand Down

0 comments on commit ebb72c3

Please sign in to comment.