Skip to content

Commit

Permalink
Sphinx: converting to path to string before comparison
Browse files Browse the repository at this point in the history
Getting rid of deprecation warning for next major Sphinx version.
  • Loading branch information
gusthoff committed Oct 26, 2024
1 parent 0d28b94 commit 423f256
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,10 @@ def get_file_from_conf_ini(path_to_file):

def setup(app):

outdir = str(app.outdir)

# TODO: find a better way to retrieve the current target (html/latex/epub)
if 'html' in app.outdir:
if 'html' in outdir:
templates_path.append('_templates')

redirects.update({
Expand Down Expand Up @@ -516,10 +518,10 @@ def setup(app):

if not os.getenv('SPHINX_LOCAL_BUILD'):
raise e
elif 'epub' in app.outdir:
elif 'epub' in outdir:
if config.has_option('', 'cover_page'):
pdf_cover_page = get_file_from_conf_ini(config['DEFAULT']['cover_page'])
png_cover_page = app.outdir + "/" + '_static/cover.jpeg'
png_cover_page = outdir + "/" + '_static/cover.jpeg'

pages = convert_from_path(pdf_path=pdf_cover_page,
dpi=72,
Expand Down

0 comments on commit 423f256

Please sign in to comment.