Skip to content

Commit 17af762

Browse files
committed
Merge branch 'obtain-token-by-browser' into dev
2 parents 0642f14 + 2021382 commit 17af762

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)