summaryrefslogtreecommitdiffstats
path: root/tools/meson-render-jinja2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/meson-render-jinja2.py')
-rwxr-xr-xtools/meson-render-jinja2.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/meson-render-jinja2.py b/tools/meson-render-jinja2.py
index 977de79378..1f893ed9a4 100755
--- a/tools/meson-render-jinja2.py
+++ b/tools/meson-render-jinja2.py
@@ -17,7 +17,9 @@ def parse_config_h(filename):
if not m:
continue
a, b = m.groups()
- if b and b[0] in '0123456789"':
+ # The function ast.literal_eval() cannot evaluate octal integers, e.g. 0600.
+ # So, it is intentional that the string below does not contain '0'.
+ if b and (b[0] in '123456789"' or b == '0'):
b = ast.literal_eval(b)
ans[a] = b
return ans