14
0
forked from pool/python-joblib
Files
python-joblib/avoid-deprecated-ast.patch
Steve Kowalik af5d476398 - Add patch avoid-deprecated-ast.patch:
* Avoid deprecated ast classes.
- Add patch also-filter-new-fork-warning.patch:
  * Filter DeprecationWarning due to calling fork() with multiprocessing.
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-joblib?expand=0&rev=60
2023-11-28 04:00:59 +00:00

25 lines
883 B
Diff

From 05caf0772d605799e5d2337018fd32ac829b37aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= <loic.esteve@ymail.com>
Date: Fri, 20 Oct 2023 19:59:00 +0200
Subject: [PATCH] MNT fix Python 3.12 deprecation warning (#1518)
---
joblib/_utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/joblib/_utils.py b/joblib/_utils.py
index 7693310e0..6cd99ad31 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): # <constant>
+ 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