From e733e5cd0a040992aa6b4c9da40225ac33264379 Mon Sep 17 00:00:00 2001 From: Victor Fors Date: Wed, 6 Apr 2022 01:13:27 +0200 Subject: [PATCH] holy fuck --- sstatus | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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: