Skip to content

Commit

Permalink
Update extension.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored May 21, 2024
1 parent ed807c2 commit f66fd84
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sphinx_design/extension.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import hashlib
from pathlib import Path
import sys

from docutils import nodes
from docutils.parsers.rst import directives
Expand Down Expand Up @@ -71,8 +70,7 @@ def update_css_js(app: Sphinx):
content = read_text(static_module, "style.min.css")
# Write the css file
if sphinx_version < (7, 1):
md5_kwargs = {"usedforsecurity": False} if sys.version_info >= (3, 9) else {}
hash = hashlib.md5(content.encode("utf8"), **md5_kwargs).hexdigest()
hash = hashlib.md5(content.encode("utf8"), usedforsecurity=False).hexdigest()
css_path = static_path / f"sphinx-design.{hash}.min.css"
else:
# since sphinx 7.1 a checksum is added to the css file URL, so there is no need to do it here
Expand Down

0 comments on commit f66fd84

Please sign in to comment.