Révision 6a0a0c8d
use json.loadS
| plugins/currency/zcash/zcash_flypool_hashrate_ | ||
|---|---|---|
| 82 | 82 |
print("Failed to request Flypool API: {}".format(exc), file=sys.stderr)
|
| 83 | 83 |
sys.exit(9) |
| 84 | 84 |
|
| 85 |
# manage codec and error handling lookup process |
|
| 86 |
reader = codecs.getreader("utf-8")
|
|
| 87 |
|
|
| 88 | 85 |
hash_rate = "U" |
| 89 | 86 |
|
| 90 | 87 |
try: |
| 91 |
mining_stats = json.load(reader(mining_stats_raw))
|
|
| 88 |
mining_stats = json.loads(mining_stats_raw.read().decode("utf-8"))
|
|
| 92 | 89 |
except ValueError: |
| 93 | 90 |
print("Failed to parse JSON responce.", file=sys.stderr)
|
| 94 | 91 |
else: |
Formats disponibles : Unified diff