Skip to content

Commit ace163b

Browse files
authored
Fix mock path for listxattr in SELinux test
1 parent 0e506f1 commit ace163b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_venv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import sys
1818
import sysconfig
1919
import tempfile
20-
import time
2120
from test.support import (captured_stdout, captured_stderr,
2221
skip_if_broken_multiprocessing_synchronize, verbose,
2322
requires_subprocess, is_android, is_apple_mobile,
@@ -374,12 +373,13 @@ def create_contents(self, paths, filename):
374373
with open(fn, 'wb') as f:
375374
f.write(b'Still here?')
376375

376+
@unittest.skipUnless(hasattr(os, 'listxattr'), 'test requires os.listxattr')
377377
def test_install_scripts_selinux(self):
378378
"""
379379
gh-145417: Test that install_scripts does not copy SELinux context
380380
when copying scripts.
381381
"""
382-
with patch('shutil.os.listxattr') as listxattr_mock:
382+
with patch('os.listxattr') as listxattr_mock:
383383
venv.create(self.env_dir)
384384
listxattr_mock.assert_not_called()
385385

0 commit comments

Comments
 (0)