jenkins-bot submitted this change.
[bugfix] Remove ThreadList.stop_all() method
ThreadList is a thread pool executor which collect a couple of Threads
and starts them running. Threads does not have a stop() method and
calling Thread.stop() leads to an AttributeError
- remove ThreadList.stop_all() due to this bug. It is not used elsewhere.
There is no easy way to stop a running Thread.
Bug: T307830
Change-Id: I8512dc654aca0f6763b016957af4c1d56a9aa0f1
---
M pywikibot/tools/__init__.py
1 file changed, 0 insertions(+), 10 deletions(-)
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 04fd27d..acb91a8 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -809,16 +809,6 @@
pywikibot.logging.debug("thread {} ('{}') started"
.format(len(self), type(thd)))
- def stop_all(self) -> None:
- """Stop all threads the pool."""
- if self:
- pywikibot.logging.debug('EARLY QUIT: Threads: {}'
- .format(len(self)))
- for thd in self:
- thd.stop()
- pywikibot.logging.debug('EARLY QUIT: Queue size left in {}: {}'
- .format(thd, thd.queue.qsize()))
-
def intersect_generators(*iterables, allow_duplicates: bool = False):
"""Generator of intersect iterables.
To view, visit change 789893. To unsubscribe, or for help writing mail filters, visit settings.