fix Profiler when called from top of stack
This commit is contained in:
parent
58a865e088
commit
7593d4ea83
@ -510,7 +510,7 @@ class Profiler(object):
|
|||||||
try:
|
try:
|
||||||
caller_object_type = type(caller_frame.f_locals["self"])
|
caller_object_type = type(caller_frame.f_locals["self"])
|
||||||
except KeyError: # we are in a regular function
|
except KeyError: # we are in a regular function
|
||||||
qualifier = caller_frame.f_globals["__name__"].split(".", 1)[1]
|
qualifier = caller_frame.f_globals["__name__"].split(".", 1)[-1]
|
||||||
else: # we are in a method
|
else: # we are in a method
|
||||||
qualifier = caller_object_type.__name__
|
qualifier = caller_object_type.__name__
|
||||||
func_qualname = qualifier + "." + caller_frame.f_code.co_name
|
func_qualname = qualifier + "." + caller_frame.f_code.co_name
|
||||||
|
Loading…
Reference in New Issue
Block a user