diff options
-rwxr-xr-x | tools/meson-render-jinja2.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/meson-render-jinja2.py b/tools/meson-render-jinja2.py index b811a15493..9a6fc7c31c 100755 --- a/tools/meson-render-jinja2.py +++ b/tools/meson-render-jinja2.py @@ -1,10 +1,12 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later -import jinja2 +import ast import re import sys +import jinja2 + def parse_config_h(filename): # Parse config.h file generated by meson. ans = {} @@ -14,7 +16,7 @@ def parse_config_h(filename): continue a, b = m.groups() if b and b[0] in '0123456789"': - b = eval(b) + b = ast.literal_eval(b) ans[a] = b return ans |