From 1737a550d319e59f5c139b5dc5e156b93495eb6a Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 5 Jun 2015 12:19:38 +0300 Subject: [PATCH] Fix for python 2 to use the safe raw_input() per default --- spotipy/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spotipy/util.py b/spotipy/util.py index 8e7827d..e3422f4 100644 --- a/spotipy/util.py +++ b/spotipy/util.py @@ -74,7 +74,11 @@ def prompt_for_user_token(username, scope=None, client_id = None, print() print() - response = input("Enter the URL you were redirected to: ") + try: + response = raw_input("Enter the URL you were redirected to: ") + except NameError: + response = input("Enter the URL you were redirected to: ") + print() print()