Skip to content

Commit

Permalink
fix for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanguage committed Sep 27, 2024
1 parent 7b365fd commit 35d1a16
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions executor/engine/job/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def __init__(self, job: "Job", valid_status: T.List[JobStatusType]):
f"but should be in {valid_status} state.")


_T = T.TypeVar("_T")
_thread_locals = threading.local()


Expand Down Expand Up @@ -66,7 +65,7 @@ def _gen_anext(fut=None): # pragma: no cover
return asyncio.run(fut.__anext__())


class GeneratorWrapper(T.Generic[_T]):
class GeneratorWrapper():
"""
wrap a generator in executor pool
"""
Expand All @@ -79,7 +78,7 @@ def __init__(self, job: "Job", fut: T.Optional[Future] = None):
def __iter__(self):
return self

def __next__(self) -> _T:
def __next__(self):
try:
if self._job._executor is not None:
return self._job._executor.submit(
Expand All @@ -106,7 +105,7 @@ def __next__(self) -> _T:
def __aiter__(self):
return self

async def __anext__(self) -> _T:
async def __anext__(self):
try:
if self._job._executor is not None:
fut = self._job._executor.submit(_gen_anext, self._fut)
Expand Down

0 comments on commit 35d1a16

Please sign in to comment.