[Logging] Fix Python 3.8 compatibility

Deluge's logger class extends Python's `logging.Logger`. Since Python
3.8, it takes an additional argument `stacklevel`.
The implementation in Deluge does not support that. Work around the
problem by ignoring additional arguments.
This commit is contained in:
minus 2019-11-17 09:36:23 +01:00
parent 5f1eada3ea
commit 351664ec07

View File

@ -86,7 +86,7 @@ class Logging(LoggingLoggerClass):
def exception(self, msg, *args, **kwargs): def exception(self, msg, *args, **kwargs):
yield LoggingLoggerClass.exception(self, msg, *args, **kwargs) yield LoggingLoggerClass.exception(self, msg, *args, **kwargs)
def findCaller(self, stack_info=False): # NOQA: N802 def findCaller(self, *args, **kwargs): # NOQA: N802
f = logging.currentframe().f_back f = logging.currentframe().f_back
rv = '(unknown file)', 0, '(unknown function)' rv = '(unknown file)', 0, '(unknown function)'
while hasattr(f, 'f_code'): while hasattr(f, 'f_code'):