From 6e22857eeceed31e52440fd77f3d5e45707e7db8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 4 Jul 2023 13:50:36 +0200
Subject: [PATCH] Avoid using deprecated ast.Num and node.n
---
joblib/_utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/joblib/_utils.py b/joblib/_utils.py
index 7693310e0..332a98737 100644
--- a/joblib/_utils.py
+++ b/joblib/_utils.py
@@ -35,8 +35,8 @@ def eval_expr(expr):
def eval_(node):
- if isinstance(node, ast.Num): # <number>
- return node.n
+ if isinstance(node, ast.Constant): # <number>
+ return node.value
elif isinstance(node, ast.BinOp): # <left> <operator> <right>
return operators[type(node.op)](eval_(node.left), eval_(node.right))
elif isinstance(node, ast.UnaryOp): # <operator> <operand> e.g., -1