[oauth] print URL if webbrowser.open fails

pull/21/head
Mike Fährmann 7 years ago
parent 090e11b35d
commit 3ee77a0902
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -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()

Loading…
Cancel
Save