autotest: removed deprecated distutils

prevent deprecation warning
This commit is contained in:
Andrew Tridgell 2022-12-17 07:47:17 +11:00
parent e142747d1f
commit 3a725ad1b0

View File

@ -10,11 +10,6 @@ from __future__ import print_function
import atexit
import fnmatch
import copy
try:
import distutils.dir_util
except ImportError:
# we copy with this with try/except in copy_tree, below
pass
import glob
import optparse
import os
@ -666,10 +661,7 @@ class TestResults(object):
def copy_tree(f, t, dirs_exist_ok=False):
try:
distutils.dir_util.copy_tree(f, t)
except Exception:
shutil.copytree(f, t, dirs_exist_ok=dirs_exist_ok)
shutil.copytree(f, t, dirs_exist_ok=dirs_exist_ok)
def write_webresults(results_to_write):