All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul Barker" <paul@pbarker.dev>
To: bitbake-devel@lists.openembedded.org
Cc: Paul Barker <paul@pbarker.dev>
Subject: [PATCH 1/1] parse/ast: Substitute '~' when naming anonymous functions
Date: Tue, 20 Jul 2021 18:16:28 +0100	[thread overview]
Message-ID: <20210720171628.23394-2-paul@pbarker.dev> (raw)
In-Reply-To: <20210720171628.23394-1-paul@pbarker.dev>

When parsing an anonymous python function, bitbake generates a name for
the function based on the full path to the file in which it was found.
As not all characters which are valid in file paths are valid in Python
function names we have a translation table. However, this translation
table was missing an entry for '~'.

Signed-off-by: Paul Barker <paul@pbarker.dev>
---
 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 50a88f7da7..743ea0dfc0 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -145,7 +145,7 @@ class DataNode(AstNode):
             data.setVar(key, val, parsing=True, **loginfo)
 
 class MethodNode(AstNode):
-    tr_tbl = str.maketrans('/.+-@%&', '_______')
+    tr_tbl = str.maketrans('/.+-@%&~', '________')
 
     def __init__(self, filename, lineno, func_name, body, python, fakeroot):
         AstNode.__init__(self, filename, lineno)
-- 
2.26.2


  reply	other threads:[~2021-07-20 17:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 17:16 [PATCH 0/1] Substitute '~' when naming anonymous functions Paul Barker
2021-07-20 17:16 ` Paul Barker [this message]
2021-07-20 17:22 ` [bitbake-devel] " Paul Barker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210720171628.23394-2-paul@pbarker.dev \
    --to=paul@pbarker.dev \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.