We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6df7e51 commit 266b7e0Copy full SHA for 266b7e0
marimo/_server/print.py
@@ -65,10 +65,11 @@ def _get_network_url(url: str) -> str:
65
hostname = socket.gethostname()
66
try:
67
# Find a non-loopback IPv4 address
68
- with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
69
- # Doesn't need to be reachable
70
- s.connect(("255.255.255.254", 1))
71
- local_ip = s.getsockname()[0]
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ # Doesn't need to be reachable
+ s.connect(("255.255.255.254", 1))
+ local_ip = s.getsockname()[0]
72
+ s.close()
73
except Exception:
74
75
# Get all IPs for the hostname
0 commit comments