We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e94dda5 + ed4c796 commit c687d5bCopy full SHA for c687d5b
msal/oauth2cli/authcode.py
@@ -48,7 +48,11 @@ def is_wsl():
48
def _browse(auth_uri, browser_name=None): # throws ImportError, webbrowser.Error
49
"""Browse uri with named browser. Default browser is customizable by $BROWSER"""
50
import webbrowser # Lazy import. Some distro may not have this.
51
- browser_opened = webbrowser.get(browser_name).open(auth_uri)
+ if browser_name:
52
+ browser_opened = webbrowser.get(browser_name).open(auth_uri)
53
+ else:
54
+ # This one can survive BROWSER=nonexist, while get(None).open(...) can not
55
+ browser_opened = webbrowser.open(auth_uri)
56
57
# In WSL which doesn't have www-browser, try launching browser with PowerShell
58
if not browser_opened and is_wsl():
0 commit comments