diff --git a/src/utils/gen.py b/src/utils/gen.py index c2275b03e..2461336b9 100644 --- a/src/utils/gen.py +++ b/src/utils/gen.py @@ -186,7 +186,10 @@ def safeEval(s, namespace=None): return all([checkNode(x) for x in node.values]) and \ all([checkNode(x) for x in node.values]) elif node.__class__ is ast.Name: - if node.id in namespace: + if namespace is None and node.id in ('True', 'False', 'None'): + # For Python < 3.4, which does not have NameConstant. + return True + elif namespace is not None and node.id in namespace: return True else: return False