Skip to content

Commit

Permalink
fix ports
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed Jan 23, 2025
1 parent 9ddbe6d commit 094087f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2150,12 +2150,10 @@ def run(

# Verify port value
try:
server_port = int(port)
assert server_port in range(1, 65536)
port = int(port)
assert port in range(1, 65536)
except Exception as e:
e.args = (
f"Expecting an integer from 1 to 65535, found port={repr(server_port)}",
)
e.args = (f"Expecting an integer from 1 to 65535, found port={repr(port)}",)
raise

# so we only see the "Running on" message once with hot reloading
Expand All @@ -2181,7 +2179,7 @@ def verify_url_part(served_part, url_part, part_name):

verify_url_part(served_url.scheme, protocol, "protocol")
verify_url_part(served_url.hostname, host, "host")
verify_url_part(served_url.port, server_port, "port")
verify_url_part(served_url.port, port, "port")

display_url = (
proxied_url.scheme,
Expand Down Expand Up @@ -2212,13 +2210,11 @@ def verify_url_part(served_part, url_part, part_name):
width=jupyter_width,
height=jupyter_height,
host=host,
port=server_port,
port=port,
server_url=jupyter_server_url,
)
else:
self.server.run(
host=host, port=server_port, debug=debug, **flask_run_options
)
self.server.run(host=host, port=port, debug=debug, **flask_run_options)

def enable_pages(self):
if not self.use_pages:
Expand Down

0 comments on commit 094087f

Please sign in to comment.