mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-10 19:46:22 +00:00
[Logging] Fix findCaller with unknown source
In case no source was found, a 3-tuple was returned instead of a 4-tuple in Python 3
This commit is contained in:
parent
351664ec07
commit
5e06aee5c8
@ -88,7 +88,7 @@ class Logging(LoggingLoggerClass):
|
||||
|
||||
def findCaller(self, *args, **kwargs): # NOQA: N802
|
||||
f = logging.currentframe().f_back
|
||||
rv = '(unknown file)', 0, '(unknown function)'
|
||||
rv = ('(unknown file)', 0, '(unknown function)', None)
|
||||
while hasattr(f, 'f_code'):
|
||||
co = f.f_code
|
||||
filename = os.path.normcase(co.co_filename)
|
||||
@ -98,11 +98,11 @@ class Logging(LoggingLoggerClass):
|
||||
):
|
||||
f = f.f_back
|
||||
continue
|
||||
if common.PY2:
|
||||
rv = (filename, f.f_lineno, co.co_name)
|
||||
else:
|
||||
rv = (filename, f.f_lineno, co.co_name, None)
|
||||
rv = (co.co_filename, f.f_lineno, co.co_name, None)
|
||||
break
|
||||
if common.PY2:
|
||||
return rv[:-1]
|
||||
else:
|
||||
return rv
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user