nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at r-updates 31 lines 1.2 kB view raw
1From bce660de0316a3b757d0274d1871eb8d1a1a51f4 Mon Sep 17 00:00:00 2001 2From: Kirill Radzikhovskyy <kirillrdy@gmail.com> 3Date: Thu, 1 Jan 2026 13:21:12 +1100 4Subject: [PATCH] Fix ast.Num/ast.Index removal in Python 3.14 5 6--- 7 pypytools/unroll.py | 10 +++++++++- 8 1 file changed, 9 insertions(+), 1 deletion(-) 9 10diff --git a/pypytools/unroll.py b/pypytools/unroll.py 11index 4bfcd5d..e5a9a69 100644 12--- a/pypytools/unroll.py 13+++ b/pypytools/unroll.py 14@@ -81,8 +81,16 @@ def unroll(self, fornode): 15 items = self.extravars[fornode.iter.id] 16 body = [] 17 for i in range(len(items)): 18+ if hasattr(ast, 'Num'): 19+ val = ast.Num(n=i) 20+ else: 21+ val = ast.Constant(value=i) 22+ if hasattr(ast, 'Index'): 23+ slice = ast.Index(value=val) 24+ else: 25+ slice = val 26 item = ast.Subscript(value=ast.Name(id=fornode.iter.id, ctx=ast.Load()), 27- slice=ast.Index(value=ast.Num(n=i)), 28+ slice=slice, 29 ctx=ast.Load()) 30 assign = ast.Assign(targets=[fornode.target], 31 value=item)