Skip to content

Commit 16b633c

Browse files
committed
gh-152936: Fix AttributeError for os.chroot on platforms without it
1 parent 907676b commit 16b633c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/test_os/test_os.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4517,7 +4517,7 @@ def test_oserror_filename(self):
45174517
try:
45184518
func(name, *func_args)
45194519
except OSError as err:
4520-
if func is os.chroot and support.is_android and os.getuid() != 0:
4520+
if support.is_android and os.getuid() != 0 and func is getattr(os, 'chroot', None):
45214521
self.assertIsNone(err.filename, str(func))
45224522
else:
45234523
self.assertIs(err.filename, name, str(func))

0 commit comments

Comments
 (0)