Skip to content

Commit

Permalink
Replaced distutils to shutil when copying files in a tree
Browse files Browse the repository at this point in the history
  • Loading branch information
asenyaev committed Dec 10, 2021
1 parent 9bcb006 commit 4d3cf77
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion modules/objc/generator/gen_objc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
from shutil import copyfile
from pprint import pformat
from string import Template
from distutils.dir_util import copy_tree

if sys.version_info >= (3, 8): # Python 3.8+
from shutil import copytree
def copy_tree(src, dst):
copytree(src, dst, dirs_exist_ok=True)
else:
from distutils.dir_util import copy_tree

try:
from io import StringIO # Python 3
Expand Down
7 changes: 6 additions & 1 deletion platforms/ios/build_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
from __future__ import print_function, unicode_literals
import glob, os, os.path, shutil, string, sys, argparse, traceback, multiprocessing, codecs, io
from subprocess import check_call, check_output, CalledProcessError
from distutils.dir_util import copy_tree

if sys.version_info >= (3, 8): # Python 3.8+
def copy_tree(src, dst):
shutil.copytree(src, dst, dirs_exist_ok=True)
else:
from distutils.dir_util import copy_tree

sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../apple'))
from cv_build_utils import execute, print_error, get_xcode_major, get_xcode_setting, get_xcode_version, get_cmake_version
Expand Down

0 comments on commit 4d3cf77

Please sign in to comment.