From 7f6b0e5a2ea3cd4925ef040733f83d996dcb1d29 Mon Sep 17 00:00:00 2001 From: Marcel Stimberg Date: Thu, 12 Sep 2024 12:15:22 +0200 Subject: [PATCH] Remove deprecated ast use These raise DeprecationWarnings on 3.13, and will raise errors with 3.15 --- brian2/parsing/functions.py | 2 -- brian2/parsing/rendering.py | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/brian2/parsing/functions.py b/brian2/parsing/functions.py index 29504b47c..53daa98dd 100644 --- a/brian2/parsing/functions.py +++ b/brian2/parsing/functions.py @@ -146,8 +146,6 @@ def visit_Call(self, node): func=ast.Name(id=node.func.id, ctx=ast.Load()), args=args, keywords=[], - starargs=None, - kwargs=None, ) diff --git a/brian2/parsing/rendering.py b/brian2/parsing/rendering.py index b60361a99..e48267208 100644 --- a/brian2/parsing/rendering.py +++ b/brian2/parsing/rendering.py @@ -102,8 +102,7 @@ def render_Call(self, node): raise ValueError("Keyword arguments not supported") else: if node.func.id in self.auto_vectorise: - vectorisation_idx = ast.Name() - vectorisation_idx.id = "_vectorisation_idx" + vectorisation_idx = ast.Name("_vectorisation_idx") args = node.args + [vectorisation_idx] else: args = node.args