mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Port over enough to get some sytests running on Python 3 (#3668)
This commit is contained in:
parent
cf6f9a8b53
commit
324525f40c
12 changed files with 91 additions and 40 deletions
|
@ -20,6 +20,8 @@ import time
|
|||
from functools import wraps
|
||||
from inspect import getcallargs
|
||||
|
||||
from six import PY3
|
||||
|
||||
_TIME_FUNC_ID = 0
|
||||
|
||||
|
||||
|
@ -28,8 +30,12 @@ def _log_debug_as_f(f, msg, msg_args):
|
|||
logger = logging.getLogger(name)
|
||||
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
lineno = f.func_code.co_firstlineno
|
||||
pathname = f.func_code.co_filename
|
||||
if PY3:
|
||||
lineno = f.__code__.co_firstlineno
|
||||
pathname = f.__code__.co_filename
|
||||
else:
|
||||
lineno = f.func_code.co_firstlineno
|
||||
pathname = f.func_code.co_filename
|
||||
|
||||
record = logging.LogRecord(
|
||||
name=name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue