def _debug_lock_release(self):
errbuf = ""
owner = self._RLock__owner
if not owner:
return errbuf
# Get stack of current owner, if lock is owned.
for tid, stack in sys._current_frames().items():
if tid != owner.ident:
continue
errbuf += "Stack of owner:\n"
for filenm, lno, func, txt in \
traceback.extract_stack(stack):
errbuf += " File: \"{0}\", line {1:d},in {2}".format(
filenm, lno, func)
if txt:
errbuf += "\n {0}".format(txt.strip())
errbuf += "\n"
break
return errbuf
评论列表
文章目录