Skip to content

Commit 9e8a9ac

Browse files
[3.14] gh-137282: Fix TypeError in tab completion and dir() of concurrent.futures (GH-137214) (#137284)
Co-authored-by: Henry Schreiner <[email protected]>
1 parent f17d77f commit 9e8a9ac

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Lib/concurrent/futures/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545

4646
def __dir__():
47-
return __all__ + ('__author__', '__doc__')
47+
return __all__ + ['__author__', '__doc__']
4848

4949

5050
def __getattr__(name):

Lib/test/test___all__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def check_all(self, modname):
7272
all_set = set(all_list)
7373
self.assertCountEqual(all_set, all_list, "in module {}".format(modname))
7474
self.assertEqual(keys, all_set, "in module {}".format(modname))
75+
# Verify __dir__ is non-empty and doesn't produce an error
76+
self.assertTrue(dir(sys.modules[modname]))
7577

7678
def walk_modules(self, basedir, modpath):
7779
for fn in sorted(os.listdir(basedir)):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix tab completion and :func:`dir` on :mod:`concurrent.futures`.

0 commit comments

Comments
 (0)