Skip to content

Commit 15b6a15

Browse files
committed
Remove unnecessary chmod from pydoc.apropos() test.
1 parent 22af5d3 commit 15b6a15

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Lib/test/test_pydoc/test_pydoc.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import _pickle
1212
import pkgutil
1313
import re
14-
import stat
1514
import tempfile
1615
import test.support
1716
import time
@@ -1303,24 +1302,14 @@ def test_apropos_with_unreadable_dir(self):
13031302
@os_helper.skip_unless_working_chmod
13041303
def test_apropos_empty_doc(self):
13051304
pkgdir = os.path.join(TESTFN, 'walkpkg')
1306-
if support.is_emscripten:
1307-
# Emscripten's readdir implementation is buggy on directories
1308-
# with read permission but no execute permission.
1309-
old_umask = os.umask(0)
1310-
self.addCleanup(os.umask, old_umask)
13111305
os.mkdir(pkgdir)
13121306
self.addCleanup(rmtree, pkgdir)
13131307
init_path = os.path.join(pkgdir, '__init__.py')
13141308
with open(init_path, 'w') as fobj:
13151309
fobj.write("foo = 1")
1316-
current_mode = stat.S_IMODE(os.stat(pkgdir).st_mode)
1317-
try:
1318-
os.chmod(pkgdir, current_mode & ~stat.S_IEXEC)
1319-
with self.restrict_walk_packages(path=[TESTFN]), captured_stdout() as stdout:
1320-
pydoc.apropos('')
1321-
self.assertIn('walkpkg', stdout.getvalue())
1322-
finally:
1323-
os.chmod(pkgdir, current_mode)
1310+
with self.restrict_walk_packages(path=[TESTFN]), captured_stdout() as stdout:
1311+
pydoc.apropos('')
1312+
self.assertIn('walkpkg', stdout.getvalue())
13241313

13251314
def test_url_search_package_error(self):
13261315
# URL handler search should cope with packages that raise exceptions

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy