summaryrefslogtreecommitdiffstats
path: root/lastfm.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2013-09-29 17:48:14 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2013-09-29 17:48:14 -0400
commitef7a80865f253852f7c7b01f04bc02b695ead67b (patch)
treeea718f746b5f9db4624057d1f0aa1df9abee8bd4 /lastfm.py
parent19346fa9068878af516cdb670bea4f791337507b (diff)
downloadlastfm-ef7a80865f253852f7c7b01f04bc02b695ead67b.tar.gz
Giving up on Python 2.5 support
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