2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Avoid a deprectationwarning in copytree handling

While trying to address one
deprecationwarning, we
hit another.  Check if the
new function exists and use it,
falling back to distutils if
everything fails.
This commit is contained in:
Jarrod Johnson 2023-08-17 14:49:44 -04:00
parent b88ccc292c
commit 7051f467bb

View File

@ -5,7 +5,7 @@ import ctypes.util
import datetime
import inspect
from shutil import copytree as copytree
if 'dirs_exist_ok' in inspect.getargspec(copytree).args:
if hasattr(inspect, 'getfullargspec') and 'dirs_exist_ok' in inspect.getfullargspec(copytree).args:
def copy_tree(src, dst):
copytree(src, dst, dirs_exist_ok=True)
else: