diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae50324..9c8d03f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: - '3.11' - '3.12' - '3.13' + - '3.14' - 'pypy-3.9' - 'pypy-3.10' env: diff --git a/simpleeval.py b/simpleeval.py index 60b7fef..885a760 100644 --- a/simpleeval.py +++ b/simpleeval.py @@ -386,13 +386,13 @@ def __init__(self, operators=None, functions=None, names=None): warnings.simplefilter("ignore") # py3.12 deprecated ast.Num, ast.Str, ast.NameConstant # https://docs.python.org/3.12/whatsnew/3.12.html#deprecated - if Num := getattr(ast, "Num"): + if Num := getattr(ast, "Num", None): self.nodes[Num] = self._eval_num - if Str := getattr(ast, "Str"): + if Str := getattr(ast, "Str", None): self.nodes[Str] = self._eval_str - if NameConstant := getattr(ast, "NameConstant"): + if NameConstant := getattr(ast, "NameConstant", None): self.nodes[NameConstant] = self._eval_constant # Defaults: