diff mbox series

[1/6] data_smart: use Pattern.search instead of findall, to match comment

Message ID 20260825194549.152553-1-chris.laplante@agilent.com
State New
Headers show
Series [1/6] data_smart: use Pattern.search instead of findall, to match comment | expand

Commit Message

chris.laplante@agilent.com Aug. 25, 2026, 7:45 p.m. UTC
From: Chris Laplante <chris.laplante@agilent.com>

The comment says "Do not run code that contains one or more unexpanded
variables", so just stop when we find one rather than look for all.

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
---
 lib/bb/data_smart.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index cbace8520..8aa7c1f99 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -126,7 +126,7 @@  class VariableParse:
 
         # Do not run code that contains one or more unexpanded variables
         # instead return the code with the characters we removed put back
-        if __expand_var_regexp__.findall(code):
+        if __expand_var_regexp__.search(code):
             return "${@" + code + "}"
 
         if self.varname: