Is_alive () gives an error instead of False after threading process in Python3

Error in Threading's is_alive () function

Where I was migrating source in Python using 2to3

if not self.thread.is_alive():

I got an error at the branch. After processing In 2, False is returned without any problem. In 3, for some reason, the following error occurs instead of False. .. ..

Exception has occurred: TypeError
'bool' object is not callable

Solution

The cause was that I had declared self._stop = False in def __init __. I just wrote to set self._stop = True as the process of ʻexcept KeyboardInterrupt:, so it should be immutable in run ()`. .. .. Although it was resolved, it was put on hold because the detailed cause was not understood. If anyone can understand it, please let me know.

Recommended Posts

Is_alive () gives an error instead of False after threading process in Python3
The story of an error in PyOCR
[python] What to do when an error occurs in send_keys of headless chrome
When you get an error in python scraping (requests)
Explanation of NoReverseMatch error in "python django super introduction"
VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
I got an error in vim and zsh in Python 3.7 series
Asynchronous processing (threading) in python
Equivalence of objects in Python
Slice error in python (´ ; ω ; `)
Implementation of quicksort in Python
Resolved an error when putting pygame in python3 on raspberry pi
How to know the internal structure of an object in Python
Various ways to create an array of numbers from 1 to 10 in Python.
Trial of writing the configuration file in Python instead of .ini etc.
What to do if PyInstaller3.5 gives an error in Python3.8 (TypeError: an integer is required (got type bytes))