summaryrefslogtreecommitdiff
path: root/scripts/analyze-migration.py
diff options
context:
space:
mode:
authorAlexey Kirillov <lekiravi@yandex-team.ru>2020-07-15 18:21:35 +0300
committerEduardo Habkost <ehabkost@redhat.com>2020-09-18 14:00:32 -0400
commit14f9cec7132bc60f9839048b0a0f8ef7ae9ed64c (patch)
tree2556624d082e281a36df339c0839b56baafe5468 /scripts/analyze-migration.py
parent1b7306f5dd7a80f4797c1644d539409031663782 (diff)
analyze-migration.py: fix read_migration_debug_json() return type
Since we use result of read_migration_debug_json() as JSON formatted string, we must provide proper type. Before Python 3.6 json.loads() method support only str typed input. Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru> Message-Id: <20200715152135.20287-1-lekiravi@yandex-team.ru> [ehabkost: added comment explaining why decode() is needed} Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'scripts/analyze-migration.py')
-rwxr-xr-xscripts/analyze-migration.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index 95838cbff3..d70ec7d33a 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -97,7 +97,8 @@ class MigrationFile(object):
# Seek back to where we were at the beginning
self.file.seek(entrypos, 0)
- return data[jsonpos:jsonpos + jsonlen]
+ # explicit decode() needed for Python 3.5 compatibility
+ return data[jsonpos:jsonpos + jsonlen].decode("utf-8")
def close(self):
self.file.close()