mirror of
https://github.com/xcat2/confluent.git
synced 2026-06-12 01:38:49 +00:00
Update to ast.Constant
Python removed ast.Num in 3.14
This commit is contained in:
@@ -107,8 +107,8 @@ class _ExpEngine(object):
|
||||
elif isinstance(parsed.ops[0], ast.Eq):
|
||||
return self.process(parsed.left) == self.process(
|
||||
parsed.comparators[0])
|
||||
if isinstance(parsed, ast.Num):
|
||||
return parsed.n
|
||||
if isinstance(parsed, ast.Constant) and isinstance(parsed.value, (int, float)):
|
||||
return parsed.value
|
||||
if isinstance(parsed, ast.Attribute):
|
||||
category = parsed.value.id
|
||||
setting = parsed.attr
|
||||
|
||||
@@ -1179,8 +1179,8 @@ class _ExpressionFormat(string.Formatter):
|
||||
return formatted
|
||||
|
||||
def _handle_ast_node(self, node):
|
||||
if isinstance(node, ast.Num):
|
||||
return node.n
|
||||
if isinstance(node, ast.Constant) and isinstance(node.value, (int, float)):
|
||||
return node.value
|
||||
elif isinstance(node, ast.Attribute):
|
||||
#ok, we have something with a dot
|
||||
left = node
|
||||
|
||||
Reference in New Issue
Block a user