nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1From 379f9476c2a5ee370cd7ec856ee9092cace88499 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
3Date: Wed, 30 Oct 2024 15:44:40 +0100
4Subject: [PATCH] Avoid ast.Str on Python 3.8+
5
6It has been deprecated since Python 3.8 and was removed from Python 3.14+.
7---
8 setup.py | 5 +++--
9 1 file changed, 3 insertions(+), 2 deletions(-)
10
11diff --git a/setup.py b/setup.py
12index 30ee0575..62272c18 100644
13--- a/setup.py
14+++ b/setup.py
15@@ -93,8 +93,9 @@ def default_environment():
16 if (len(a.targets) == 1 and
17 isinstance(a.targets[0], ast.Name) and
18 a.targets[0].id == "__version__" and
19- isinstance(a.value, ast.Str)):
20- version = a.value.s
21+ ((sys.version_info >= (3, 8) and isinstance(a.value, ast.Constant)) or
22+ isinstance(a.value, ast.Str))):
23+ version = a.value.value if sys.version_info >= (3, 8) else a.value.s
24
25 setup(name='html5lib',
26 version=version,