mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-20 05:38:35 +00:00
targets/steamvr: Use python stdlib to copy
monado/src/xrt/targets/steamvr_drv/copy_assets.py:8: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.dir_util import copy_tree monado/src/xrt/targets/steamvr_drv/copy_assets.py:8: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.dir_util import copy_tree
This commit is contained in:
parent
8bbaf2a05b
commit
d4a491ea74
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from distutils.dir_util import copy_tree
|
|
||||||
from distutils.file_util import copy_file
|
import shutil
|
||||||
|
|
||||||
print(sys.argv[1], sys.argv[2], sys.argv[3])
|
print(sys.argv[1], sys.argv[2], sys.argv[3])
|
||||||
|
|
||||||
|
@ -22,9 +22,14 @@ output_path = sys.argv[3]
|
||||||
os.makedirs(os.path.dirname(output_path), exist_ok=True)
|
os.makedirs(os.path.dirname(output_path), exist_ok=True)
|
||||||
|
|
||||||
if is_file:
|
if is_file:
|
||||||
copy_file(input_path, output_path)
|
try:
|
||||||
|
os.remove(output_path)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
shutil.copyfile(input_path, output_path)
|
||||||
elif is_dir:
|
elif is_dir:
|
||||||
copy_tree(input_path, output_path)
|
shutil.rmtree(output_path, ignore_errors=True)
|
||||||
|
shutil.copytree(input_path, output_path)
|
||||||
else:
|
else:
|
||||||
print(sys.argv[1], "must be FILE or DIRECTORY")
|
print(sys.argv[1], "must be FILE or DIRECTORY")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in a new issue