From a43e841f9a7e2671a7515f54ba5f9293abf53a56 Mon Sep 17 00:00:00 2001 From: Florian Franzen Date: Fri, 25 Sep 2026 04:30:49 +0200 Subject: [PATCH] python3Packages.untokenize: fix build with Python 3.14 --- .../development/python-modules/untokenize/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/untokenize/default.nix b/pkgs/development/python-modules/untokenize/default.nix index b12a9f382db7..d20b84fd01de 100644 --- a/pkgs/development/python-modules/untokenize/default.nix +++ b/pkgs/development/python-modules/untokenize/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchPypi, - pythonAtLeast, unittestCheckHook, }: @@ -11,14 +10,18 @@ buildPythonPackage rec { version = "0.1.1"; format = "setuptools"; - # https://github.com/myint/untokenize/issues/4 - disabled = pythonAtLeast "3.14"; - src = fetchPypi { inherit pname version; sha256 = "3865dbbbb8efb4bb5eaa72f1be7f3e0be00ea8b7f125c69cbd1f5fda926f37a2"; }; + # the deprecated ast.Constant.s alias was removed in Python 3.14 + # https://github.com/myint/untokenize/pull/6 + postPatch = '' + substituteInPlace setup.py \ + --replace-fail "body[0].value.s" "body[0].value.value" + ''; + nativeCheckInputs = [ unittestCheckHook ]; meta = {