mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
[3.6] bpo-29212: Fix the ugly repr() ThreadPoolExecutor thread name. (GH-2315) (#3276)
bpo-29212: Fix the ugly ThreadPoolExecutor thread name.
Fixes the newly introduced ugly default thread name for concurrent.futures
thread.ThreadPoolExecutor threads. They'll now resemble the old <=3.5
threading default Thread-x names by being named ThreadPoolExecutor-y_n..
(cherry picked from commit a3d91b43c2
)
This commit is contained in:
parent
31b8efeaa8
commit
7d8282d25d
3 changed files with 13 additions and 5 deletions
|
@ -191,10 +191,9 @@ class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest, BaseTestCase
|
|||
del executor
|
||||
|
||||
for t in threads:
|
||||
# We don't particularly care what the default name is, just that
|
||||
# it has a default name implying that it is a ThreadPoolExecutor
|
||||
# followed by what looks like a thread number.
|
||||
self.assertRegex(t.name, r'^.*ThreadPoolExecutor.*_[0-4]$')
|
||||
# Ensure that our default name is reasonably sane and unique when
|
||||
# no thread_name_prefix was supplied.
|
||||
self.assertRegex(t.name, r'ThreadPoolExecutor-\d+_[0-4]$')
|
||||
t.join()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue