diff options
author | Oliver Chang <oliverchang@users.noreply.github.com> | 2021-10-28 15:46:24 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 15:46:24 +1100 |
commit | 094e40044f09472920b9ef568d253b4dc7ad816f (patch) | |
tree | 08cd7285f581e41a8c3c4803d2f7a8fc48246e09 /infra | |
parent | c7f7c240404e32291a1fd54829b42966b0db7a30 (diff) |
Use shutil.copytree instead of dir_util.copy_tree. (#6673)
We can use shutil.copytree's dirs_exist_ok now that we have a new
Python.
Diffstat (limited to 'infra')
-rw-r--r-- | infra/cifuzz/filestore/git/__init__.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/infra/cifuzz/filestore/git/__init__.py b/infra/cifuzz/filestore/git/__init__.py index 5414003d..636ed693 100644 --- a/infra/cifuzz/filestore/git/__init__.py +++ b/infra/cifuzz/filestore/git/__init__.py @@ -13,7 +13,6 @@ # limitations under the License. """Module for a git based filestore.""" -from distutils import dir_util import logging import os import shutil @@ -98,7 +97,7 @@ class GitFilestore(filestore.BaseFilestore): if replace and os.path.exists(full_repo_path): shutil.rmtree(full_repo_path) - dir_util.copy_tree(local_path, full_repo_path) + shutil.copytree(local_path, full_repo_path, dirs_exist_ok=True) self._git('add', '.') try: self._git('commit', '-m', message) @@ -140,7 +139,7 @@ class GitFilestore(filestore.BaseFilestore): logging.debug('Corpus does not exist at %s.', path) return False - dir_util.copy_tree(path, dst_directory) + shutil.copytree(path, dst_directory, dirs_exist_ok=True) return True def download_build(self, name, dst_directory): @@ -155,5 +154,5 @@ class GitFilestore(filestore.BaseFilestore): logging.debug('Coverage does not exist at %s.', path) return False - dir_util.copy_tree(path, dst_directory) + shutil.copytree(path, dst_directory, dirs_exist_ok=True) return True |