Skip to content

Commit e3d30a4

Browse files
committed
examples/deepzoom: Work around pathlib incompat in old Jinja2
FileSystemLoader in Jinja2 < 2.11.0 (including on Ubuntu 20.04) fails to wrap a single Path argument in a list because it thinks it's already a sequence. Work around this. Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent cd3216d commit e3d30a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/deepzoom/deepzoom_tile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def _write_html(self) -> None:
335335
# We're not running from a module (e.g. "python deepzoom_tile.py")
336336
# so PackageLoader('__main__') doesn't work in jinja2 3.x.
337337
# Load templates directly from the filesystem.
338-
loader = jinja2.FileSystemLoader(Path(__file__).parent / 'templates')
338+
loader = jinja2.FileSystemLoader([Path(__file__).parent / 'templates'])
339339
env = jinja2.Environment(loader=loader, autoescape=True)
340340
template = env.get_template('slide-multipane.html')
341341
associated_urls = {n: self._url_for(n) for n in self._slide.associated_images}

0 commit comments

Comments
 (0)