Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
os.PathLike[str] works with any str path-like object (e.g. pathlib.Pa…
…th) too

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
  • Loading branch information
hugovk and CAM-Gerlach authored Feb 17, 2023
commit eea9d0284c9cdf2203471845c18dba53a77e1b15
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'.github',
]

def _asset_hash(path: str) -> str:
def _asset_hash(path: os.PathLike[str]) -> str:
"""Append a `?digest=` to an url based on the file content."""
full_path = (Path(html_static_path[0]) / path).resolve()
digest = hashlib.sha1(full_path.read_bytes()).hexdigest()
Expand Down