def start(self):
if self._active:
raise RuntimeError('type checker already running')
elif self._pending:
raise RuntimeError('type checker already starting up')
self._pending = True
# Install this instance as the current profiler
self._previous_profiler = sys.getprofile()
self._set_caller_level_shift(0)
sys.setprofile(self)
# If requested, set this instance as the default profiler for all future threads
# (does not affect existing threads)
if self.all_threads:
self._previous_thread_profiler = threading._profile_hook
threading.setprofile(self)
self._active, self._pending = True, False
评论列表
文章目录