Skip to content

Commit

Permalink
fix: typed
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Mar 1, 2024
1 parent 279212f commit 824e978
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/timeout_executor/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _init_process(
input_file: Path | anyio.Path,
output_file: Path | anyio.Path,
stacklevel: int = 2,
) -> AsyncResult:
) -> AsyncResult[T]:
logger.debug("%r before init process", self, stacklevel=stacklevel)
executor_args_builder = partial(
self._create_executor_args, input_file, output_file
Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def callbacks(self) -> Iterable[ProcessCallback]:


async def wait_process(
process: subprocess.Popen, timeout: float, input_file: Path | anyio.Path
process: subprocess.Popen[str], timeout: float, input_file: Path | anyio.Path
) -> None:
wait_func = partial(sync_to_async(process.wait), timeout)
if not isinstance(input_file, anyio.Path):
Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/terminate.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def remove_callback(self, callback: ProcessCallback) -> Self:
return self


def terminate(process: subprocess.Popen, terminator: Terminator) -> None:
def terminate(process: subprocess.Popen[str], terminator: Terminator) -> None:
try:
with suppress(TimeoutError, subprocess.TimeoutExpired):
process.wait(terminator.timeout)
Expand Down

0 comments on commit 824e978

Please sign in to comment.