diff --git a/sphinx/util/fileutil.py b/sphinx/util/fileutil.py index 7caf40275..fcbc8abe6 100644 --- a/sphinx/util/fileutil.py +++ b/sphinx/util/fileutil.py @@ -74,6 +74,10 @@ def copy_asset(source, destination, excluded=lambda path: False, context=None, r if not os.path.exists(source): return + if renderer is None: + from sphinx.util.template import SphinxRenderer + renderer = SphinxRenderer() + ensuredir(destination) if os.path.isfile(source): copy_asset_file(source, destination, context, renderer)