File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,13 @@ def _can_bind_at_any_port(address_family: socket.AddressFamily | int) -> bool:
8787 Returns:
8888 Whether any port is available for binding.
8989 """
90- with closing ( socket . socket ( address_family , socket . SOCK_STREAM )) as sock :
91- try :
90+ try :
91+ with closing ( socket . socket ( address_family , socket . SOCK_STREAM )) as sock :
9292 sock .bind (("" , 0 )) # Bind to any available port
93- except ( OverflowError , PermissionError , OSError ) as e :
94- console . debug ( f"Unable to bind to any port for { address_family } : { e } " )
95- return False
96- return True
93+ return True
94+ except ( OverflowError , PermissionError , OSError ) as e :
95+ console . debug ( f"Unable to bind to any port for { address_family } : { e } " )
96+ return False
9797
9898
9999def is_process_on_port (
You can’t perform that action at this time.
0 commit comments