File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1405,7 +1405,7 @@ import ast
1405
1405
from ast import Num, BinOp, UnaryOp
1406
1406
import operator as op
1407
1407
1408
- legal_operators = {ast.Add: op.add,
1408
+ LEGAL_OPERATORS = {ast.Add: op.add,
1409
1409
ast.Sub: op.sub,
1410
1410
ast.Mult: op.mul,
1411
1411
ast.Div: op.truediv,
@@ -1424,9 +1424,9 @@ def eval_node(node):
1424
1424
if node_type not in [BinOp, UnaryOp]:
1425
1425
raise TypeError (node)
1426
1426
operator_type = type (node.op)
1427
- if operator_type not in legal_operators :
1427
+ if operator_type not in LEGAL_OPERATORS :
1428
1428
raise TypeError (f ' Illegal operator { node.op} ' )
1429
- operator = legal_operators [operator_type]
1429
+ operator = LEGAL_OPERATORS [operator_type]
1430
1430
if node_type == BinOp:
1431
1431
left, right = eval_node(node.left), eval_node(node.right)
1432
1432
return operator(left, right)
You can’t perform that action at this time.
0 commit comments