jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/505459 )
Change subject: [python 3.8] threading.Thread.isAlive() method is deprecated ......................................................................
[python 3.8] threading.Thread.isAlive() method is deprecated
The isAlive() method of threading.Thread has been deprecated. The renaming to is_alive() was done in python 2.6
Change-Id: I7322d86a73133fa28f97d3b1e0b406fd08645137 --- M pywikibot/__init__.py M pywikibot/tools/__init__.py M scripts/weblinkchecker.py 3 files changed, 5 insertions(+), 5 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 2caa6f0..a4cbfdc 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -1366,7 +1366,7 @@ '{lightblue}Waiting for {num} pages to be put. ' 'Estimated time remaining: {sec}{default}', num=num, sec=sec))
- while _putthread.isAlive() and page_put_queue.qsize() > 0: + while _putthread.is_alive() and page_put_queue.qsize() > 0: try: _putthread.join(1) except KeyboardInterrupt: @@ -1400,7 +1400,7 @@
def async_request(request, *args, **kwargs): """Put a request on the queue, and start the daemon if necessary.""" - if not _putthread.isAlive(): + if not _putthread.is_alive(): try: page_put_queue.mutex.acquire() try: diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index 4515301..8bd43d5 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -842,7 +842,7 @@
def __iter__(self): """Iterate results from the queue.""" - if not self.isAlive() and not self.finished.isSet(): + if not self.is_alive() and not self.finished.isSet(): self.start() # if there is an item in the queue, yield it, otherwise wait while not self.finished.isSet(): @@ -985,7 +985,7 @@ """Return the number of alive threads and delete all non-alive ones.""" cnt = 0 for item in self[:]: - if item.isAlive(): + if item.is_alive(): cnt += 1 else: self.remove(item) diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py index e3d5d69..320c8b8 100755 --- a/scripts/weblinkchecker.py +++ b/scripts/weblinkchecker.py @@ -1031,7 +1031,7 @@ # wait until the report thread is shut down; the user can # interrupt it by pressing CTRL-C. try: - while bot.history.reportThread.isAlive(): + while bot.history.reportThread.is_alive(): time.sleep(0.1) except KeyboardInterrupt: pywikibot.output('Report thread interrupted.')
pywikibot-commits@lists.wikimedia.org