Skip to content

Commit 0d7ca19

Browse files
committed
Update default port in Manager.connect to use None instead of integer value
This was the default behavior for launch. For a value type, where the absense of the port doesn't really matter, using `int` instead of `Optional[int]` makes more sense, but consistency is more important, and switching launch to `int` could break user code.
1 parent c4ac446 commit 0d7ca19

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

python/saleae/automation/manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def fail(reason: str):
397397
def connect(cls,
398398
*,
399399
address: str = _DEFAULT_GRPC_ADDRESS,
400-
port: int = _DEFAULT_GRPC_PORT,
400+
port: Optional[int] = None,
401401
connect_timeout_seconds: Optional[float] = None,
402402
grpc_channel_arguments: Optional[List[Tuple[str, Any]]] = None) -> 'Manager':
403403
"""Connect to an existing instance of Logic 2.
@@ -408,6 +408,9 @@ def connect(cls,
408408
:param grpc_channel_arguments: See __init__
409409
"""
410410

411+
if port is None:
412+
port = _DEFAULT_GRPC_PORT
413+
411414
return cls(address=address,
412415
port=port,
413416
connect_timeout_seconds=connect_timeout_seconds,

0 commit comments

Comments
 (0)