mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4926 from tk0miya/optimize_copy_asset
Optimize copy_asset()
This commit is contained in:
commit
baca035fa2
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user