summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/data_smart.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 9436023b30..1e65014028 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -65,9 +65,8 @@ class DataSmart:
65 def python_sub(match): 65 def python_sub(match):
66 code = match.group()[3:-1] 66 code = match.group()[3:-1]
67 codeobj = compile(code.strip(), varname or "<expansion>", "eval") 67 codeobj = compile(code.strip(), varname or "<expansion>", "eval")
68 s = utils.better_eval(codeobj, {"d": self}) 68 value = utils.better_eval(codeobj, {"d": self})
69 if isinstance(s, int): s = str(s) 69 return str(value)
70 return s
71 70
72 if not isinstance(s, basestring): # sanity check 71 if not isinstance(s, basestring): # sanity check
73 return s 72 return s
@@ -80,9 +79,8 @@ class DataSmart:
80 try: 79 try:
81 s = __expand_var_regexp__.sub(var_sub, s) 80 s = __expand_var_regexp__.sub(var_sub, s)
82 s = __expand_python_regexp__.sub(python_sub, s) 81 s = __expand_python_regexp__.sub(python_sub, s)
83 if s == olds: break 82 if s == olds:
84 if not isinstance(s, basestring): # sanity check 83 break
85 bb.msg.error(bb.msg.domain.Data, 'expansion of %s returned non-string %s' % (olds, s))
86 except KeyboardInterrupt: 84 except KeyboardInterrupt:
87 raise 85 raise
88 except: 86 except: