Skip to content

Commit 29e672a

Browse files
authored
Merge pull request #288 from AzureAD/acquire-token-interactive
Chanbge acquire_token_interactive to lazy import webbrowser
2 parents 210c273 + 0ccb44f commit 29e672a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msal/oauth2cli/authcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
It optionally opens a browser window to guide a human user to manually login.
66
After obtaining an auth code, the web server will automatically shut down.
77
"""
8-
import webbrowser
98
import logging
109
import socket
1110
from string import Template
@@ -35,6 +34,7 @@ def obtain_auth_code(listen_port, auth_uri=None): # Historically only used in t
3534

3635

3736
def _browse(auth_uri):
37+
import webbrowser # Lazy import. Some distro may not have this.
3838
controller = webbrowser.get() # Get a default controller
3939
# Some Linux Distro does not setup default browser properly,
4040
# so we try to explicitly use some popular browser, if we found any.

0 commit comments

Comments
 (0)