Skip to content

Commit a1125fd

Browse files
author
Pavel Marek
committed
Use shutil instead of distutils for copying directories.
1 parent 8f0753d commit a1125fd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mx.fastr/mx_fastr_dists.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -24,9 +24,6 @@
2424
import mx_sdk
2525
import os, string, shutil
2626
from os.path import join, basename, isfile
27-
import distutils
28-
# for some reason the script fails without this import:
29-
from distutils import dir_util # pylint: disable=unused-import,no-name-in-module
3027

3128
_fastr_suite = mx.suite('fastr')
3229

@@ -84,7 +81,10 @@ def build(self):
8481
fastr_dir = _fastr_suite.dir
8582
for d in ['bin', 'include', 'library', 'etc', 'share', 'doc']:
8683
target_dir = join(output_dir, d)
87-
distutils.dir_util.copy_tree(join(fastr_dir, d), target_dir, update=True)
84+
source_dir = join(fastr_dir, d)
85+
if os.path.exists(target_dir):
86+
shutil.rmtree(target_dir)
87+
shutil.copytree(source_dir, target_dir)
8888

8989
lib_fastr_dir = join(fastr_dir, 'lib')
9090
lib_output_dir = join(output_dir, 'lib')

0 commit comments

Comments
 (0)