File: fix-setup.py-for-py3.14-ast.Constant-change.patch

package info (click to toggle)
python-untokenize 0.1.1-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 132 kB
  • sloc: python: 325; makefile: 35
file content (25 lines) | stat: -rw-r--r-- 801 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Fix setup.py for py3.14 ast.Constant change
 Python 3.8+ replaced ast.Str with ast.Constant. Accessing `.s` breaks
 under Python 3.14. Update version parsing to handle ast.Constant.
Author: Emmanuel Arias <eamanu@debian.org>
Bug-Debian: https://bugs.debian.org/1122468
Forwarded: yes
Last-Update: 2025-12-19

---
 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 206c57e..b925e7a 100755
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ def version():
     with open('untokenize.py') as input_file:
         for line in input_file:
             if line.startswith('__version__'):
-                return ast.parse(line).body[0].value.s
+                return ast.parse(line).body[0].value.value
 
 
 with open('README.rst') as readme: