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

Commitcc43f00

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 commitcc43f00

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎setup.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@ def default_environment():
9393
if (len(a.targets)==1and
9494
isinstance(a.targets[0],ast.Name)and
9595
a.targets[0].id=="__version__"and
96-
isinstance(a.value,ast.Str)):
97-
version=a.value.s
96+
(
97+
(hasattr(ast,"Str")andisinstance(a.value,ast.Str))or
98+
(isinstance(a.value,ast.Constant)andisinstance(a.value.value,str))
99+
)
100+
):
101+
version=getattr(a.value,"s",a.value.value)
98102

99103
setup(name='html5lib',
100104
version=version,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp