Skip to content

Commit 28c9e29

Browse files
Backport PR jupyter-server#1095 on branch 1.x (Defer webbrowser import) (jupyter-server#1097)
Co-authored-by: Steven Silvester <[email protected]>
1 parent 66ac73e commit 28c9e29

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jupyter_server/serverapp.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import time
2626
import urllib
2727
import warnings
28-
import webbrowser
2928
from base64 import encodebytes
3029

3130
try:
@@ -2689,6 +2688,10 @@ def _prepare_browser_open(self):
26892688
return assembled_url, open_file
26902689

26912690
def launch_browser(self):
2691+
# Deferred import for environments that do not have
2692+
# the webbrowser module.
2693+
import webbrowser
2694+
26922695
try:
26932696
browser = webbrowser.get(self.browser or None)
26942697
except webbrowser.Error as e:

0 commit comments

Comments
 (0)