Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/retry/compat.py: 33%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import functools
2import logging
5try:
6 from decorator import decorator
7except ImportError:
8 def decorator(caller):
9 """ Turns caller into a decorator.
10 Unlike decorator module, function signature is not preserved.
12 :param caller: caller(f, *args, **kwargs)
13 """
14 def decor(f):
15 @functools.wraps(f)
16 def wrapper(*args, **kwargs):
17 return caller(f, *args, **kwargs)
18 return wrapper
19 return decor
22try: # Python 2.7+
23 from logging import NullHandler
24except ImportError:
25 class NullHandler(logging.Handler):
27 def emit(self, record):
28 pass