Skip to content

Commit

Permalink
drop str-casts for mimetype requests
Browse files Browse the repository at this point in the history
Paths pushed into `guess_mimetype` were casted to strings to support
Sphinx-6.1 and older versions. Since we no longer support these
versions, dropping these casts.

Signed-off-by: James Knight <[email protected]>
  • Loading branch information
jdknight committed Dec 5, 2024
1 parent de46e60 commit 8b7dfa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions sphinxcontrib/confluencebuilder/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ def _handle_entry(self, path, docname, standalone=False):

if path not in self.path2asset:
hash_ = ConfluenceUtil.hash_asset(path)
# str-cast for sphinx-6.1
type_ = guess_mimetype(str(path), default=DEFAULT_CONTENT_TYPE)
type_ = guess_mimetype(path, default=DEFAULT_CONTENT_TYPE)
else:
hash_ = self.path2asset[path].hash
type_ = self.path2asset[path].type
Expand Down
2 changes: 1 addition & 1 deletion sphinxcontrib/confluencebuilder/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def confluence_supported_svg(builder, node):
return

# ignore non-svgs
mimetype = guess_mimetype(str(abs_path)) # cast for sphinx-6.1
mimetype = guess_mimetype(abs_path)
if mimetype != 'image/svg+xml':
return

Expand Down

0 comments on commit 8b7dfa4

Please sign in to comment.