From 501882ea3d4fec51baa1c8711ef78786bd40de7b Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 18 Jul 2024 14:19:04 +0200 Subject: Fix ast deprecation warnings --- gerbonara/aperture_macros/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gerbonara/aperture_macros/parse.py b/gerbonara/aperture_macros/parse.py index 33c205e..3887d98 100644 --- a/gerbonara/aperture_macros/parse.py +++ b/gerbonara/aperture_macros/parse.py @@ -20,8 +20,8 @@ def rad_to_deg(x): return (x / math.pi) * 180 def _map_expression(node, variables={}, parameters=set()): - if isinstance(node, ast.Num): - return ConstantExpression(node.n) + if isinstance(node, ast.Constant): + return ConstantExpression(node.value) elif isinstance(node, ast.BinOp): op_map = {ast.Add: operator.add, ast.Sub: operator.sub, ast.Mult: operator.mul, ast.Div: operator.truediv} -- cgit