Skip to contentSkip to conversation

patch: Use repr() with exceptions instead of str()

PATCH New Richard Purdie 1 participant 1 message Oct 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patch: Use repr() with exceptions instead of str()

This gives more meaningful errors.

---
 meta/classes/patch.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/patch.bbclass +2 -2
index 87bcaf91a87..fdf3c633bc8 100644
@@ -150,12 +150,12 @@ python patch_do_patch() {
             patchset.Import({"file":local, "strippath": parm['striplevel']}, True)
         except Exception as exc:
             bb.utils.remove(process_tmpdir, True)
-            bb.fatal("Importing patch '%s' with striplevel '%s'\n%s" % (parm['patchname'], parm['striplevel'], str(exc)))
+            bb.fatal("Importing patch '%s' with striplevel '%s'\n%s" % (parm['patchname'], parm['striplevel'], repr(exc)))
         try:
             resolver.Resolve()
         except bb.BBHandledException as e:
             bb.utils.remove(process_tmpdir, True)
-            bb.fatal("Applying patch '%s' on target directory '%s'\n%s" % (parm['patchname'], patchdir, str(e)))
+            bb.fatal("Applying patch '%s' on target directory '%s'\n%s" % (parm['patchname'], patchdir, repr(e)))
 
     bb.utils.remove(process_tmpdir, True)
     del os.environ['TMPDIR']
Signature · 1 line
2.32.0