From 6a0a0c8d58544ec2969282df4e31bde5f78ce137 Mon Sep 17 00:00:00 2001 From: Nils Date: Fri, 30 Mar 2018 20:56:12 +0200 Subject: [PATCH] use json.loadS --- plugins/currency/zcash/zcash_flypool_hashrate_ | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/currency/zcash/zcash_flypool_hashrate_ b/plugins/currency/zcash/zcash_flypool_hashrate_ index 079f7198..8db6effc 100755 --- a/plugins/currency/zcash/zcash_flypool_hashrate_ +++ b/plugins/currency/zcash/zcash_flypool_hashrate_ @@ -82,13 +82,10 @@ except IOError as exc: print("Failed to request Flypool API: {}".format(exc), file=sys.stderr) sys.exit(9) -# manage codec and error handling lookup process -reader = codecs.getreader("utf-8") - hash_rate = "U" try: - mining_stats = json.load(reader(mining_stats_raw)) + mining_stats = json.loads(mining_stats_raw.read().decode("utf-8")) except ValueError: print("Failed to parse JSON responce.", file=sys.stderr) else: