From 5d15b1cc1ad986a41b8304e3ec8b7bb0074c654b Mon Sep 17 00:00:00 2001 From: David Gnedt Date: Sat, 31 Jul 2021 01:34:45 +0200 Subject: [PATCH] Chdir outside temp directory before removing it to make Windows happy --- test/test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test.py b/test/test.py index ccd64d1..1b756c0 100755 --- a/test/test.py +++ b/test/test.py @@ -1866,6 +1866,7 @@ def copytree(src, dst, ignore=None): # copy the testdata into a temp dir in order to avoid .svn dirs breaking some tests tmpdatapath = tempfile.mkdtemp() +orig_path = os.getcwd() try: copytree(cfvtest.datapath, tmpdatapath, ignore=['.svn']) os.chdir(tmpdatapath) # do this after the setcfv, since the user may have specified a relative path @@ -1881,4 +1882,5 @@ def copytree(src, dst, ignore=None): failed += all_tests() sys.exit(failed) finally: + os.chdir(orig_path) shutil.rmtree(tmpdatapath)