Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb90daff

Browse files
committed
setup.py: fix version parsing on Python 3.14 (ast.Str removed)
Python 3.14 removes the ast.Str node type. String literals now appearas ast.Constant(value=str).Update the AST check to accept both ast.Str (for older Pythons) andast.Constant with a string value (for Python 3.8+), allowing html5lib tobuild successfully on Python 3.14 while remaining compatible with olderversion.
1 parentfd4f032 commitb90daff

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎setup.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,14 @@ def default_environment():
9292
forainassignments:
9393
if (len(a.targets)==1and
9494
isinstance(a.targets[0],ast.Name)and
95-
a.targets[0].id=="__version__"and
96-
isinstance(a.value,ast.Str)):
97-
version=a.value.s
95+
a.targets[0].id=="__version__"):
96+
ifhasattr(ast,"Str")andisinstance(a.value,ast.Str):
97+
version=a.value.s
98+
elif (hasattr(ast,"Constant")
99+
andisinstance(a.value,ast.Constant)
100+
andisinstance(a.value.value,str)):
101+
version=a.value.value
102+
assertversionisnotNone
98103

99104
setup(name='html5lib',
100105
version=version,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp