10 whoCallsError =
"whoCallsError" 21 for i
in range(1,1000):
28 exc_info = sys.exc_info()
30 f = exc_info[2].tb_frame.f_back
54 for file,function,line
in info[1 + strip:]:
55 buf.append(
" %s(%s): %s()" % (file,line,function))
57 return string.join(buf,
"\n")
64 t,v,tb = sys.exc_info()
69 return ((
'',
'',
''), str(t), str(v),
'traceback is None!!!')
72 tb.tb_frame.f_code.co_filename,
73 tb.tb_frame.f_code.co_name,
83 file, function, line = tbinfo[-1]
84 info =
'[' + string.join (
86 lambda x: string.join (x,
'|'),
92 return (file, function, line), str(t), str(v), info
104 for modname,m
in sys.modules.items():
107 if type(o)
is types.ClassType:
108 name =
"%s:%s" % (modname,o.__name__)
109 cnt = sys.getrefcount (o)
113 elif cnt > base.get(name, 0):
114 d[name] = cnt - base.get(name, 0)
122 pairs = map (
lambda x: (x[1],x[0]), d.items())
139 log(
'%10d %s' % (n, c))
def get_refcounts(base=None)
def pretty_who_calls(strip=0)
def real_get_refcounts(base=None, set_base=0)