Skip to content

Commit 738c1ae

Browse files
committed
Merge branch 'peprolinbot-bugfix/issue_46/ignore_webbrowser_not_loaded' into bugfix/issue_46
2 parents 5487482 + 0a56113 commit 738c1ae

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dyndns/domain_setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import json
22
import os.path
3-
import webbrowser
3+
try:
4+
import webbrowser
5+
except ModuleNotFoundError:
6+
pass
7+
import sys
48
from builtins import input
59

610
from domainconnect import DomainConnect, DomainConnectAsyncCredentials, TemplateNotSupportedException, \
@@ -43,8 +47,8 @@ def main(domain, protocols, settings='settings.txt'):
4347
params=params,
4448
redirect_uri='https://dynamicdns.domainconnect.org/ddnscode'
4549
)
46-
47-
webbrowser.open(context.asyncConsentUrl, autoraise=True)
50+
if "webbrowser" in sys.modules:
51+
webbrowser.open(context.asyncConsentUrl, autoraise=True)
4852
code = input("Please open\n{}\nand provide us the access code:".format(context.asyncConsentUrl))
4953

5054
tries = 1

0 commit comments

Comments
 (0)