diff --git a/sstatus b/sstatus index 6e32be2..06914b3 100755 --- a/sstatus +++ b/sstatus @@ -3,7 +3,10 @@ import requests import sys import textwrap import pprint -import simplejson +try: + from simplejson.errors import JSONDecodeError +except ImportError: + from json.decoder import JSONDecodeError api = 'http://api.steampowered.com/' key = '63578AF8E85EDF1E49411D5D4E18E166' @@ -20,7 +23,7 @@ def json_query(url, transform, params={}): sys.exit(1) try: data = result.json() - except simplejson.errors.JSONDecodeError as err: + except JSONDecodeError as err: print('Error when decoding JSON:\nFrom endpoint ' + url + ':\n' + str(err) + '\n' + str(result) + '\n') sys.exit(1) try: