Skip to content

Commit

Permalink
Merge pull request #1065 from sphinx-contrib/drop-legacy-str-casts
Browse files Browse the repository at this point in the history
drop str-casts for mimetype requests
  • Loading branch information
jdknight authored Dec 5, 2024
2 parents e6f05c4 + 8b7dfa4 commit 662a26b
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 @@ -282,8 +282,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 662a26b

Please sign in to comment.