|
11 | 11 | import _pickle
|
12 | 12 | import pkgutil
|
13 | 13 | import re
|
14 |
| -import stat |
15 | 14 | import tempfile
|
16 | 15 | import test.support
|
17 | 16 | import time
|
@@ -1303,24 +1302,14 @@ def test_apropos_with_unreadable_dir(self):
|
1303 | 1302 | @os_helper.skip_unless_working_chmod
|
1304 | 1303 | def test_apropos_empty_doc(self):
|
1305 | 1304 | 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) |
1311 | 1305 | os.mkdir(pkgdir)
|
1312 | 1306 | self.addCleanup(rmtree, pkgdir)
|
1313 | 1307 | init_path = os.path.join(pkgdir, '__init__.py')
|
1314 | 1308 | with open(init_path, 'w') as fobj:
|
1315 | 1309 | 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()) |
1324 | 1313 |
|
1325 | 1314 | def test_url_search_package_error(self):
|
1326 | 1315 | # URL handler search should cope with packages that raise exceptions
|
|
0 commit comments