Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit f7c5d7b

Browse files
committed
Call run_server synchronously when not in IPython context
1 parent cf24b55 commit f7c5d7b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jupyter_dash/jupyter_app.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ def run_server(
146146
:param kwargs: Additional keyword arguments to pass to the superclass
147147
``Dash.run_server`` method.
148148
"""
149+
# Get superclass run_server method
150+
super_run_server = super(JupyterDash, self).run_server
151+
149152
if not JupyterDash._in_ipython:
150-
# No op else to do when not running in a Jupyter context
153+
# If not in IPython context, call run run_server synchronously
154+
super_run_server(**kwargs)
151155
return
152156

153157
# Get host and port
@@ -186,9 +190,6 @@ def run_server(
186190
# Terminate any existing server using this port
187191
self._terminate_server_for_port(host, port)
188192

189-
# Run superclass run_server is separate thread
190-
super_run_server = super(JupyterDash, self).run_server
191-
192193
# Configure pathname prefix
193194
requests_pathname_prefix = self.config.get('requests_pathname_prefix', None)
194195
if self._input_pathname_prefix is None:

0 commit comments

Comments
 (0)