fix Profiler when called from top of stack

This commit is contained in:
Luke Campagnola 2018-04-25 15:07:21 -07:00
parent 58a865e088
commit 7593d4ea83

View File

@ -510,7 +510,7 @@ class Profiler(object):
try:
caller_object_type = type(caller_frame.f_locals["self"])
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
qualifier = caller_object_type.__name__
func_qualname = qualifier + "." + caller_frame.f_code.co_name