Commit a2173a18 authored by Vinay Sajip's avatar Vinay Sajip

Catch situations where currentframe() returns None. See SF patch #1447410,...

Catch situations where currentframe() returns None. See SF patch #1447410, this is a different implementation.
parent 5424ad8a
......@@ -1058,13 +1058,16 @@ class Logger(Filterer):
file name, line number and function name.
"""
f = currentframe().f_back
while 1:
rv = "(unknown file)", 0, "(unknown function)"
while hasattr(f, "f_code"):
co = f.f_code
filename = os.path.normcase(co.co_filename)
if filename == _srcfile:
f = f.f_back
continue
return filename, f.f_lineno, co.co_name
rv = (filename, f.f_lineno, co.co_name)
break
return rv
def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=None, extra=None):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment