summaryrefslogtreecommitdiffstats
path: root/lastfm.py
diff options
context:
space:
mode:
Diffstat (limited to 'lastfm.py')
-rw-r--r--lastfm.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/lastfm.py b/lastfm.py
index 60781d5..dca9628 100644
--- a/lastfm.py
+++ b/lastfm.py
@@ -1,8 +1,6 @@
-from __future__ import with_statement
import requests
import sys
-import simplejson as json
from time import sleep
from collections import deque
from types import *
@@ -25,7 +23,7 @@ def make_request(method, payload):
r = requests.get(URL, params=params, headers=user_agent)
try:
- answer = json.loads(r.text)
+ answer = r.json()
except ValueError: # request failed for some reason, retrying
i = 0
while r.status_code == 503 and i < 3:
@@ -33,7 +31,7 @@ def make_request(method, payload):
r = requests.get(URL, params=params, headers=user_agent)
i += 1
try:
- answer = json.loads(r.text)
+ answer = r.json()
except ValueError: # giving up
answer = None