Skip to content

Commit 9920460

Browse files
committed
fix: mypy
1 parent d9e6c57 commit 9920460

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

deploy/sdk/src/dynamo/sdk/cli/circus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def get_env_or_reserved_port(env_var):
104104
if port_env:
105105
return int(port_env)
106106
else:
107-
with reserve_free_port() as port:
107+
with reserve_free_port() as port: # type: ignore
108108
return port
109109

110110

deploy/sdk/src/dynamo/sdk/cli/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import os
2525
import pathlib
2626
import socket
27-
from typing import Any, DefaultDict, Dict, Protocol, TextIO, Union
27+
from typing import Any, DefaultDict, Dict, Iterator, Protocol, TextIO, Union
2828

2929
import typer
3030
import yaml
@@ -61,8 +61,8 @@ def dynamo_address(self) -> tuple[str, str]:
6161
class PortReserver:
6262
def __init__(self, host: str = "localhost"):
6363
self.host = host
64-
self.socket = None
65-
self.port = None
64+
self.socket: socket.socket | None = None
65+
self.port: int | None = None
6666

6767
def __enter__(self) -> int:
6868
try:
@@ -91,7 +91,7 @@ def close_socket(self):
9191
@contextlib.contextmanager
9292
def reserve_free_port(
9393
host: str = "localhost",
94-
) -> contextlib.AbstractContextManager[int]:
94+
) -> Iterator[int]:
9595
"""
9696
Detect free port and reserve until exit the context.
9797
Returns a context manager that yields the reserved port.

0 commit comments

Comments
 (0)