aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-01-28 15:02:31 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2022-01-30 02:13:42 +0530
commit19684d23e811c3cc1ec2f03c63926cbdf982dd58 (patch)
tree7b5260fdbce16ffa8db22d0c9e187b70808d0d51 /unittests
parent2512c25c0bb3649c4cc8be20ac30d59630241ae4 (diff)
downloadmeson-19684d23e811c3cc1ec2f03c63926cbdf982dd58.zip
meson-19684d23e811c3cc1ec2f03c63926cbdf982dd58.tar.gz
meson-19684d23e811c3cc1ec2f03c63926cbdf982dd58.tar.bz2
unittests: Fix warning about distutils deprecation
unittests/rewritetests.py:19: 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
Diffstat (limited to 'unittests')
-rw-r--r--unittests/rewritetests.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/unittests/rewritetests.py b/unittests/rewritetests.py
index 161ae9d..4979c51 100644
--- a/unittests/rewritetests.py
+++ b/unittests/rewritetests.py
@@ -15,9 +15,10 @@
import subprocess
import json
import os
+import shutil
import unittest
-from distutils.dir_util import copy_tree
+from mesonbuild.mesonlib import windows_proof_rmtree
from .baseplatformtests import BasePlatformTests
class RewriterTests(BasePlatformTests):
@@ -26,7 +27,9 @@ class RewriterTests(BasePlatformTests):
self.maxDiff = None
def prime(self, dirname):
- copy_tree(os.path.join(self.rewrite_test_dir, dirname), self.builddir)
+ if os.path.exists(self.builddir):
+ windows_proof_rmtree(self.builddir)
+ shutil.copytree(os.path.join(self.rewrite_test_dir, dirname), self.builddir)
def rewrite_raw(self, directory, args):
if isinstance(args, str):