mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-23 06:35:42 +00:00
use json.loadS
This commit is contained in:
parent
6ff34af50e
commit
6a0a0c8d58
1 changed files with 1 additions and 4 deletions
|
@ -82,13 +82,10 @@ except IOError as exc:
|
||||||
print("Failed to request Flypool API: {}".format(exc), file=sys.stderr)
|
print("Failed to request Flypool API: {}".format(exc), file=sys.stderr)
|
||||||
sys.exit(9)
|
sys.exit(9)
|
||||||
|
|
||||||
# manage codec and error handling lookup process
|
|
||||||
reader = codecs.getreader("utf-8")
|
|
||||||
|
|
||||||
hash_rate = "U"
|
hash_rate = "U"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mining_stats = json.load(reader(mining_stats_raw))
|
mining_stats = json.loads(mining_stats_raw.read().decode("utf-8"))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("Failed to parse JSON responce.", file=sys.stderr)
|
print("Failed to parse JSON responce.", file=sys.stderr)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue