Skip to content

Commit e7e2c3d

Browse files
Add try-except to support both Dash >=2.0 and <2.0 (#318)
1 parent 5ff348b commit e7e2c3d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

explainerdashboard/dashboards.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,10 +1272,12 @@ def run(self, port=None, host="0.0.0.0", use_waitress=False, mode=None, **kwargs
12721272
)
12731273
if use_waitress:
12741274
from waitress import serve
1275-
12761275
serve(app.server, host=host, port=port)
12771276
else:
1278-
app.run_server(port=port, host=host, **kwargs)
1277+
try:
1278+
app.run(port=port, host=host, **kwargs)
1279+
except AttributeError:
1280+
app.run_server(port=port, host=host, **kwargs)
12791281
else:
12801282
if self.mode == "dash":
12811283
print(

0 commit comments

Comments
 (0)