@@ -2150,12 +2150,10 @@ def run(
2150
2150
2151
2151
# Verify port value
2152
2152
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 )
2155
2155
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 )} " ,)
2159
2157
raise
2160
2158
2161
2159
# 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):
2181
2179
2182
2180
verify_url_part (served_url .scheme , protocol , "protocol" )
2183
2181
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" )
2185
2183
2186
2184
display_url = (
2187
2185
proxied_url .scheme ,
@@ -2212,13 +2210,11 @@ def verify_url_part(served_part, url_part, part_name):
2212
2210
width = jupyter_width ,
2213
2211
height = jupyter_height ,
2214
2212
host = host ,
2215
- port = server_port ,
2213
+ port = port ,
2216
2214
server_url = jupyter_server_url ,
2217
2215
)
2218
2216
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 )
2222
2218
2223
2219
def enable_pages (self ):
2224
2220
if not self .use_pages :
0 commit comments