def stop(self):
if self._active and not self._pending:
self._pending = True
if sys.getprofile() is self:
sys.setprofile(self._previous_profiler)
if not self._previous_profiler is None and \
isinstance(self._previous_profiler, TypeAgent):
self._previous_profiler._set_caller_level_shift(0)
else:
if not (sys.getprofile() is None and self._cleared):
warn('the system profiling hook has changed unexpectedly')
if self.all_threads:
if threading._profile_hook is self:
threading.setprofile(self._previous_thread_profiler)
else: # pragma: no cover
warn('the threading profiling hook has changed unexpectedly')
self._active, self._pending = False, False
评论列表
文章目录