mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Fix utils.gen.safeEval to work with instances of ast.NameConstant (introduced in Pythn 3.4).
This commit is contained in:
parent
65aed8f7ed
commit
28536f0528
@ -187,6 +187,9 @@ def safeEval(s, namespace={'True': True, 'False': False, 'None': None}):
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
elif sys.version_info[0:2] >= (3, 4) and \
|
||||||
|
node.__class__ is ast.NameConstant:
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
if checkNode(node):
|
if checkNode(node):
|
||||||
|
Loading…
Reference in New Issue
Block a user