[oauth] print URL if webbrowser.open fails

This commit is contained in:
Mike Fährmann
2017-06-08 19:46:24 +02:00
parent 090e11b35d
commit 3ee77a0902

View File

@@ -77,7 +77,10 @@ class OAuthReddit(OAuthBase):
}
url = "https://www.reddit.com/api/v1/authorize?"
url += urllib.parse.urlencode(params)
webbrowser.open(url)
if not webbrowser.open(url):
print("Please open this URL in your browser:")
print(url, end="\n\n", flush=True)
params = self.recv()