]> code.ossystems Code Review - openembedded-core.git/commitdiff
patch: Use repr() with exceptions instead of str()
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Oct 2021 10:54:59 +0000 (11:54 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 16 Oct 2021 16:35:01 +0000 (17:35 +0100)
This gives more meaningful errors.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/patch.bbclass

index 87bcaf91a87f793ff42f1bc2672c237816f99c2a..fdf3c633bc8e85f2a52847842cf8e9b28b19f7d0 100644 (file)
@@ -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']