def _ismainthread():
"""
utility function for testing, returns True if we are currently executing in the main thread"""
# see:
# http://stackoverflow.com/questions/23206787/check-if-current-thread-is-main-thread-in-python
return isinstance(threading.current_thread(), threading._MainThread)
评论列表
文章目录