summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrigori Fursin <grigori.fursin@cTuning.org>2017-05-24 15:08:34 +0200
committerGrigori Fursin <grigori.fursin@cTuning.org>2017-05-24 15:08:34 +0200
commit35e2e6c3a45f5bf05863b4f46dd79702aef19556 (patch)
tree77094b426e95433aa9522befa2e91d68bced4b99
parent953a5a9c2246439f1c68a0872bbf83d5d0dd466f (diff)
changing "wb" to "w" when saving json file (text mode) - compatibility for Python 3
-rw-r--r--scripts/benchmark/benchmark.py2
-rw-r--r--scripts/database/database/io.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/benchmark/benchmark.py b/scripts/benchmark/benchmark.py
index a5f216c6..3239d385 100644
--- a/scripts/benchmark/benchmark.py
+++ b/scripts/benchmark/benchmark.py
@@ -120,7 +120,7 @@ def benchmark_single(benchmark, platform, device, num_runs, precision, load_from
# Stores the results to disk
print("[benchmark] Saving benchmark results to '" + json_file_name + "'")
- with open(json_file_name, "wb") as f:
+ with open(json_file_name, "w") as f:
json.dump(results, f, sort_keys=True, indent=4)
# Retrieves the data from the benchmark settings
diff --git a/scripts/database/database/io.py b/scripts/database/database/io.py
index 0bba2ce1..58f9103b 100644
--- a/scripts/database/database/io.py
+++ b/scripts/database/database/io.py
@@ -32,7 +32,7 @@ def load_database(filename):
def save_database(database, filename):
"""Saves a database to disk"""
print("[database] Saving database to '" + filename + "'")
- with open(filename, "wb") as f:
+ with open(filename, "w") as f:
json.dump(database, f, sort_keys=True, indent=4)