All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parse/ast.py: MethodNode fix character mapping error
@ 2015-07-10 16:44 Aníbal Limón
  2015-07-10 16:55 ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Aníbal Limón @ 2015-07-10 16:44 UTC (permalink / raw)
  To: bitbake-devel

When found an anonymous function the func name is made by filename
and lineno, the filename need to be converted to string before using
translation because produces an error of encoding.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
 lib/bb/parse/ast.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 1130b14..4937006 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -149,7 +149,7 @@ class MethodNode(AstNode):
     def eval(self, data):
         text = '\n'.join(self.body)
         if self.func_name == "__anonymous":
-            funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(MethodNode.tr_tbl)))
+            funcname = ("__anon_%s_%s" % (self.lineno, str(self.filename).translate(MethodNode.tr_tbl)))
             text = "def %s(d):\n" % (funcname) + text
             bb.methodpool.insert_method(funcname, text, self.filename)
             anonfuncs = data.getVar('__BBANONFUNCS', False) or []
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-10 20:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 16:44 [PATCH] parse/ast.py: MethodNode fix character mapping error Aníbal Limón
2015-07-10 16:55 ` Richard Purdie
2015-07-10 20:16   ` Aníbal Limón
2015-07-10 20:21     ` Christopher Larson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.