@@ -2150,12 +2150,10 @@ def run(
21502150
21512151 # Verify port value
21522152 try :
2153- server_port = int (port )
2154- assert server_port in range (1 , 65536 )
2153+ port = int (port )
2154+ assert port in range (1 , 65536 )
21552155 except Exception as e :
2156- e .args = (
2157- f"Expecting an integer from 1 to 65535, found port={ repr (server_port )} " ,
2158- )
2156+ e .args = (f"Expecting an integer from 1 to 65535, found port={ repr (port )} " ,)
21592157 raise
21602158
21612159 # so we only see the "Running on" message once with hot reloading
@@ -2181,7 +2179,7 @@ def verify_url_part(served_part, url_part, part_name):
21812179
21822180 verify_url_part (served_url .scheme , protocol , "protocol" )
21832181 verify_url_part (served_url .hostname , host , "host" )
2184- verify_url_part (served_url .port , server_port , "port" )
2182+ verify_url_part (served_url .port , port , "port" )
21852183
21862184 display_url = (
21872185 proxied_url .scheme ,
@@ -2212,13 +2210,11 @@ def verify_url_part(served_part, url_part, part_name):
22122210 width = jupyter_width ,
22132211 height = jupyter_height ,
22142212 host = host ,
2215- port = server_port ,
2213+ port = port ,
22162214 server_url = jupyter_server_url ,
22172215 )
22182216 else :
2219- self .server .run (
2220- host = host , port = server_port , debug = debug , ** flask_run_options
2221- )
2217+ self .server .run (host = host , port = port , debug = debug , ** flask_run_options )
22222218
22232219 def enable_pages (self ):
22242220 if not self .use_pages :
0 commit comments