]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
image-fuzzer: Use %r for all fiels at Field.__repr__()
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 16 Oct 2019 19:24:25 +0000 (16:24 -0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 5 Nov 2019 15:35:06 +0000 (16:35 +0100)
This makes the formatting code simpler, and safer if we change
the type of self.value from str to bytes.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20191016192430.25098-6-ehabkost@redhat.com
Message-Id: <20191016192430.25098-6-ehabkost@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/image-fuzzer/qcow2/layout.py

index 6501c9fd4b1503f779f58753013e6ebd8a8f3a98..0adcbd448d1dc32ec8f6b02a46eb751c5dce0cf8 100644 (file)
@@ -53,8 +53,8 @@ class Field(object):
         return iter([self.fmt, self.offset, self.value, self.name])
 
     def __repr__(self):
-        return "Field(fmt='%s', offset=%d, value=%s, name=%s)" % \
-            (self.fmt, self.offset, str(self.value), self.name)
+        return "Field(fmt=%r, offset=%r, value=%r, name=%r)" % \
+            (self.fmt, self.offset, self.value, self.name)
 
 
 class FieldsList(object):