Skip to content

Commit

Permalink
Fix tests for py39 and add py312
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsca committed Oct 3, 2023
1 parent 057011d commit 32451fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ addopts = "--doctest-modules"
legacy_tox_ini = """
[tox]
skipsdist = True
envlist = py39,py310,py311
envlist = py39,py310,py311,py312
[testenv]
skip_install = true
Expand Down
5 changes: 4 additions & 1 deletion src/jinjax/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ def eval_expression(input_string):
for name in code.co_names:
if name not in ALLOWED_NAMES_IN_EXPRESSION_VALUES:
raise InvalidArgument(f"Use of {name} not allowed")
return eval(code, {"__builtins__": {}}, ALLOWED_NAMES_IN_EXPRESSION_VALUES)
try:
return eval(code, {"__builtins__": {}}, ALLOWED_NAMES_IN_EXPRESSION_VALUES)
except NameError as err:
raise InvalidArgument(err)


def is_valid_variable_name(name):
Expand Down

0 comments on commit 32451fc

Please sign in to comment.