Currently crashing on Python 3 with:
$ scripts/analyze-migration.py -m -f vm.state
TypeError: ord() expected string of length 1, but int found
Signed-off-by: Pawel Zmarzly <[email protected]>
---
scripts/analyze-migration.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index 67631ac43e..3303c05358 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -56,7 +56,7 @@ def readvar(self, size = None):
if size is None:
size = self.read8()
if size == 0:
- return ""
+ return b""
value = self.file.read(size)
if len(value) != size:
raise Exception("Unexpected end of %s at 0x%x" % (self.filename,
self.file.tell()))
@@ -200,7 +200,7 @@ def read(self):
self.files[self.name].seek(addr, os.SEEK_SET)
self.files[self.name].write(data)
if self.dump_memory:
- hexdata = " ".join("{0:02x}".format(ord(c)) for c in data)
+ hexdata = " ".join("{0:02x}".format(c) for c in data)
self.memory['%s (0x%016x)' % (self.name, addr)] = hexdata
flags &= ~self.RAM_SAVE_FLAG_PAGE
--
2.51.1