Skip to content

Commit

Permalink
Avoid ast.Str on Python 3.8+
Browse files Browse the repository at this point in the history
It has been deprecated since Python 3.8 and was removed from Python 3.14+.
  • Loading branch information
hroncok committed Oct 30, 2024
1 parent fd4f032 commit 379f947
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def default_environment():
if (len(a.targets) == 1 and
isinstance(a.targets[0], ast.Name) and
a.targets[0].id == "__version__" and
isinstance(a.value, ast.Str)):
version = a.value.s
((sys.version_info >= (3, 8) and isinstance(a.value, ast.Constant)) or
isinstance(a.value, ast.Str))):
version = a.value.value if sys.version_info >= (3, 8) else a.value.s

setup(name='html5lib',
version=version,
Expand Down

0 comments on commit 379f947

Please sign in to comment.