Merge pull request #4926 from tk0miya/optimize_copy_asset

Optimize copy_asset()
This commit is contained in:
Takeshi KOMIYA 2018-05-03 01:30:07 +09:00 committed by GitHub
commit baca035fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,6 +74,10 @@ def copy_asset(source, destination, excluded=lambda path: False, context=None, r
if not os.path.exists(source): if not os.path.exists(source):
return return
if renderer is None:
from sphinx.util.template import SphinxRenderer
renderer = SphinxRenderer()
ensuredir(destination) ensuredir(destination)
if os.path.isfile(source): if os.path.isfile(source):
copy_asset_file(source, destination, context, renderer) copy_asset_file(source, destination, context, renderer)