From 0d21375c7b36389c85c5fea02e4981ff4f5568ec Mon Sep 17 00:00:00 2001 From: tison Date: Fri, 13 Oct 2023 02:39:20 +0800 Subject: [PATCH] python: Switch away from deprecated copy_tree API. Signed-off-by: tison --- lib/website.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/website.py b/lib/website.py index 051d52bc1319a1..157ff16dfbb1eb 100644 --- a/lib/website.py +++ b/lib/website.py @@ -15,9 +15,8 @@ """ from pathlib import Path -from distutils.dir_util import copy_tree import html -from shutil import copyfile +from shutil import copyfile, copytree from .url import ( sanitize_stream, @@ -111,10 +110,11 @@ def build_website( page_footer_html, ) - # Copy the entire content of /assets into md_root. - # We use copy_tree from distutils instead of shutil.copytree so that it - # doesn't raise an error when assets/ already exists inside the md_root. - copy_tree(str(Path(repo_root) / "assets"), str(Path(md_root) / "assets")) + copytree( + str(Path(repo_root) / "assets"), + str(Path(md_root) / "assets"), + dirs_exist_ok=True, + ) # Copy .nojekyll into md_root as well. copyfile(str(Path(repo_root) / ".nojekyll"), str(Path(md_root) / ".nojekyll"))