Swap use of subprocess.call for webbrowser.open in util.py

This commit is contained in:
delucks 2016-12-20 22:44:03 -08:00
parent 39d4ee4193
commit 3587e107c0

View File

@ -3,9 +3,9 @@
from __future__ import print_function
import os
import subprocess
from . import oauth2
import spotipy
import webbrowser
def prompt_for_user_token(username, scope=None, client_id = None,
client_secret = None, redirect_uri = None):
@ -67,8 +67,8 @@ def prompt_for_user_token(username, scope=None, client_id = None,
''')
auth_url = sp_oauth.get_authorize_url()
try:
subprocess.call(["open", auth_url])
print("Opening %s in your browser" % auth_url)
webbrowser.open(auth_url)
print("Opened %s in your browser" % auth_url)
except:
print("Please navigate here: %s" % auth_url)