Skip to content

Commit e808c9d

Browse files
[3.9] bpo-42782: fix broken shutil test (GH-31971)
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.
1 parent 612019e commit e808c9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_shutil.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ def test_move_dir_permission_denied(self):
21542154

21552155
# Create a file and keep the directory immutable
21562156
os.lchflags(TESTFN_SRC, stat.UF_OPAQUE)
2157-
os_helper.create_empty_file(os.path.join(TESTFN_SRC, 'child'))
2157+
support.create_empty_file(os.path.join(TESTFN_SRC, 'child'))
21582158
os.lchflags(TESTFN_SRC, stat.SF_IMMUTABLE)
21592159

21602160
# Testing on a non-empty immutable directory
@@ -2164,10 +2164,10 @@ def test_move_dir_permission_denied(self):
21642164
finally:
21652165
if os.path.exists(TESTFN_SRC):
21662166
os.lchflags(TESTFN_SRC, stat.UF_OPAQUE)
2167-
os_helper.rmtree(TESTFN_SRC)
2167+
support.rmtree(TESTFN_SRC)
21682168
if os.path.exists(TESTFN_DST):
21692169
os.lchflags(TESTFN_DST, stat.UF_OPAQUE)
2170-
os_helper.rmtree(TESTFN_DST)
2170+
support.rmtree(TESTFN_DST)
21712171

21722172

21732173
class TestCopyFile(unittest.TestCase):

0 commit comments

Comments
 (0)