Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/concurrent/futures/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,7 @@ def __init__(self, max_workers=None, thread_name_prefix='',
each worker interpreter.
initargs: A tuple of arguments to pass to the initializer.
"""
thread_name_prefix = (thread_name_prefix or
(f"InterpreterPoolExecutor-{self._counter()}"))
super().__init__(max_workers, thread_name_prefix,
initializer, initargs)
4 changes: 4 additions & 0 deletions Lib/test/test_concurrent_futures/test_interpreter_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,10 @@ def test_import_interpreter_pool_executor(self):
self.assertEqual(p.stdout.decode(), '')
self.assertEqual(p.stderr.decode(), '')

def test_thread_name_prefix(self):
self.assertStartsWith(self.executor._thread_name_prefix,
"InterpreterPoolExecutor-")


class AsyncioTest(InterpretersMixin, testasyncio_utils.TestCase):

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix :class:`concurrent.futures.InterpreterPoolExecutor`'s custom thread
name.
Loading