]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-42782: fix broken shutil test (GH-31971)
authorJelle Zijlstra <jelle.zijlstra@gmail.com>
Fri, 18 Mar 2022 02:45:40 +0000 (19:45 -0700)
committerGitHub <noreply@github.com>
Fri, 18 Mar 2022 02:45:40 +0000 (19:45 -0700)
We were using os_helper, which doesn't exist on 3.9. This wasn't
caught because the test is only run as root. I confirmed that when
run as root, the test previously failed and now passes.

Lib/test/test_shutil.py

index 85cac94dfec78daf08de7f6b02e3913999fb86c5..3890df93bbccdc85e35b6b366595776a19f64694 100644 (file)
@@ -2154,7 +2154,7 @@ class TestMove(BaseTest, unittest.TestCase):
 
             # Create a file and keep the directory immutable
             os.lchflags(TESTFN_SRC, stat.UF_OPAQUE)
-            os_helper.create_empty_file(os.path.join(TESTFN_SRC, 'child'))
+            support.create_empty_file(os.path.join(TESTFN_SRC, 'child'))
             os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE)
 
             # Testing on a non-empty immutable directory
@@ -2164,10 +2164,10 @@ class TestMove(BaseTest, unittest.TestCase):
         finally:
             if os.path.exists(TESTFN_SRC):
                 os.lchflags(TESTFN_SRC, stat.UF_OPAQUE)
-                os_helper.rmtree(TESTFN_SRC)
+                support.rmtree(TESTFN_SRC)
             if os.path.exists(TESTFN_DST):
                 os.lchflags(TESTFN_DST, stat.UF_OPAQUE)
-                os_helper.rmtree(TESTFN_DST)
+                support.rmtree(TESTFN_DST)
 
 
 class TestCopyFile(unittest.TestCase):