summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorminus <minus@mnus.de>2019-11-19 17:14:01 +0100
committerminus <minus@mnus.de>2019-11-19 17:44:48 +0100
commit5e06aee5c8846f94bd5fcc209132dacf06de781f (patch)
tree939dea9e0028e761162af038dd6caed980fe49f3
parent351664ec071daa04161577c6a1c949ed0f2c3206 (diff)
downloaddeluge-5e06aee5c8846f94bd5fcc209132dacf06de781f.zip
deluge-5e06aee5c8846f94bd5fcc209132dacf06de781f.tar.gz
deluge-5e06aee5c8846f94bd5fcc209132dacf06de781f.tar.bz2
[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
-rw-r--r--deluge/log.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/deluge/log.py b/deluge/log.py
index 0f9877f..bf4f3c2 100644
--- a/deluge/log.py
+++ b/deluge/log.py
@@ -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,12 +98,12 @@ 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
- return rv
+ if common.PY2:
+ return rv[:-1]
+ else:
+ return rv
levels = {