Thread (2 messages) 2 messages, 1 author, 2021-10-25
STALE1737d

[PATCH 2/2] patch: Fix exception reporting with repr()

From: Richard Purdie <hidden>
Date: 2021-10-25 20:10:11
Subsystem: the rest · Maintainer: Linus Torvalds

The exceptions generated with repre are more detailed but escaped the
newlines making them unreadable. Fix this.

Signed-off-by: Richard Purdie <redacted>
---
 meta/classes/patch.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index fdf3c633bc8..8de70254919 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -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'], repr(exc)))
+            bb.fatal("Importing patch '%s' with striplevel '%s'\n%s" % (parm['patchname'], parm['striplevel'], repr(exc).replace("\\n", "\n")))
         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, repr(e)))
+            bb.fatal("Applying patch '%s' on target directory '%s'\n%s" % (parm['patchname'], patchdir, repr(e).replace("\\n", "\n")))
 
     bb.utils.remove(process_tmpdir, True)
     del os.environ['TMPDIR']
-- 
2.32.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help