public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] template.bbclass: fix warning by using a raw string for regular expressions
@ 2024-03-11 13:44 nicusor.huhulea
  2024-03-15 13:01 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: nicusor.huhulea @ 2024-03-11 13:44 UTC (permalink / raw)
  To: isar-users

the warning is:
DEBUG: Executing python function do_transform_template
/build/../work/isar/meta/classes/template.bbclass:24: DeprecationWarning: invalid escape sequence '\$'

fix this by adding 'r' before opening quote in order to treat the string
as raw string, preventing the interpretation of backslashes as escape characters

Signed-off-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>

diff --git a/meta/classes/template.bbclass b/meta/classes/template.bbclass
index 1f4cedbd..7f8d5d8f 100644
--- a/meta/classes/template.bbclass
+++ b/meta/classes/template.bbclass
@@ -21,7 +21,7 @@ python do_transform_template() {
         return
 
     cmd = "envsubst"
-    args = " ".join("\${{{}}}".format(i) for i in template_vars)
+    args = " ".join(r"\${{{}}}".format(i) for i in template_vars)
 
     # Copy current process environment and add template variables
     # from bitbake data store:

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

* Re: [PATCH] template.bbclass: fix warning by using a raw string for regular expressions
  2024-03-11 13:44 [PATCH] template.bbclass: fix warning by using a raw string for regular expressions nicusor.huhulea
@ 2024-03-15 13:01 ` Uladzimir Bely
  0 siblings, 0 replies; 2+ messages in thread
From: Uladzimir Bely @ 2024-03-15 13:01 UTC (permalink / raw)
  To: nicusor.huhulea, isar-users

On Mon, 2024-03-11 at 13:44 +0000, 'nicusor.huhulea@siemens.com' via
isar-users wrote:
> the warning is:
> DEBUG: Executing python function do_transform_template
> /build/../work/isar/meta/classes/template.bbclass:24:
> DeprecationWarning: invalid escape sequence '\$'
> 
> fix this by adding 'r' before opening quote in order to treat the
> string
> as raw string, preventing the interpretation of backslashes as escape
> characters
> 
> Signed-off-by: Nicusor Huhulea <nicusor.huhulea@siemens.com>
> 

Applied to next, thanks.

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

end of thread, other threads:[~2024-03-15 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-11 13:44 [PATCH] template.bbclass: fix warning by using a raw string for regular expressions nicusor.huhulea
2024-03-15 13:01 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox