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

Commit379f947

Browse files
committed
Avoid ast.Str on Python 3.8+
It has been deprecated since Python 3.8 and was removed from Python 3.14+.
1 parentfd4f032 commit379f947

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ 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+
((sys.version_info>= (3,8)andisinstance(a.value,ast.Constant))or
97+
isinstance(a.value,ast.Str))):
98+
version=a.value.valueifsys.version_info>= (3,8)elsea.value.s
9899

99100
setup(name='html5lib',
100101
version=version,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp