ROS package executes rosrun error: attributeerror: ‘thread’ object has no attribute ‘isalive‘

1.Error Messages:
joes@joes:~/jiao/Project/demo01_ws$ rosrun helloworld helloworld_p.py
[INFO] [1636100465.680519]: Hello World by python_____from Jiaozhidong
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/core.py”, line 513, in _ros_atexit
signal_shutdown(‘atexit’)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/core.py”, line 496, in signal_shutdown
if t.isAlive():
AttributeError: ‘Thread’ object has no attribute ‘isAlive’

II. Solution.
1. sudo gedit /opt/ros/kinetic/lib/python2.7/dist-packages/rospy/core.py
(Fix it according to your own alarm path.)
2. Search for t.isAlive() in the alarm prompt
3. change t.isAlive() to t.is_alive()
Reason: python3 no longer supports isAlive function, need to update to is_alive format.

Read More: