mirror of
https://github.com/xcat2/confluent.git
synced 2026-01-11 18:42:29 +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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user