From 2566d06e245eda1e2a9cb6d6bb94feea12d5aa84 Mon Sep 17 00:00:00 2001 From: NiklasRosenstein Date: Fri, 20 Dec 2019 08:10:17 +0100 Subject: [PATCH] Show value in PackError to help debug #1 --- movutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/movutils.py b/movutils.py index d3a059c..26d219e 100644 --- a/movutils.py +++ b/movutils.py @@ -145,8 +145,8 @@ def pack_into_stream(self, struct_type, fp, value): try: fp.write(self.fmt.pack(*value)) except struct.error as e: - raise PackError('field {}.{}: {}'.format( - struct_type.__name__, self.name, e)) + raise PackError('field {}.{} (value: {!r}): {}'.format( + struct_type.__name__, self.name, value, e)) class ListField(Field):