Skip to content

Commit

Permalink
Fix compatibility with older Sphinx versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Peque committed Jan 18, 2024
1 parent 4b51c23 commit ad17535
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sphinxemoji/sphinxemoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,16 @@ def apply(self):


def copy_asset_files(app, exc):
if exc is not None: # build failed
return
asset_files = [
resources.files('sphinxemoji') / 'twemoji.js',
resources.files('sphinxemoji') / 'twemoji.css',
]
if exc is None: # build succeeded
for path in asset_files:
copy_asset(path, os.path.join(app.outdir, '_static'))
for path in asset_files:
# Compatibility with Sphinx < 7.2 (Path would raise an exception)
path = str(path)
copy_asset(path, os.path.join(app.outdir, '_static'))


def setup(app):
Expand Down

0 comments on commit ad17535

Please sign in to comment.