projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up the remote executor stuff and create a dedicated heartbeat
[python_utils.git]
/
decorator_utils.py
diff --git
a/decorator_utils.py
b/decorator_utils.py
index d5349cc31aed2e74352822c3175ace022ab20e74..eb5a0c9b9ff581fc3c4398e1e1ab186ec3d00978 100644
(file)
--- a/
decorator_utils.py
+++ b/
decorator_utils.py
@@
-443,7
+443,7
@@
def retry_if_false(tries: int, *, delay_sec=3.0, backoff=2.0):
3
>>> dur > 2.0
True
3
>>> dur > 2.0
True
- >>> dur < 2.
2
+ >>> dur < 2.
3
True
"""
True
"""
@@
-479,7
+479,7
@@
def deprecated(func):
def wrapper_deprecated(*args, **kwargs):
msg = f"Call to deprecated function {func.__qualname__}"
logger.warning(msg)
def wrapper_deprecated(*args, **kwargs):
msg = f"Call to deprecated function {func.__qualname__}"
logger.warning(msg)
- warnings.warn(msg, category=DeprecationWarning)
+ warnings.warn(msg, category=DeprecationWarning
, stacklevel=2
)
print(msg, file=sys.stderr)
return func(*args, **kwargs)
return wrapper_deprecated
print(msg, file=sys.stderr)
return func(*args, **kwargs)
return wrapper_deprecated
@@
-507,7
+507,6
@@
def thunkify(func):
exc[0] = True
exc[1] = sys.exc_info() # (type, value, traceback)
msg = f"Thunkify has thrown an exception (will be raised on thunk()):\n{traceback.format_exc()}"
exc[0] = True
exc[1] = sys.exc_info() # (type, value, traceback)
msg = f"Thunkify has thrown an exception (will be raised on thunk()):\n{traceback.format_exc()}"
- print(msg)
logger.warning(msg)
finally:
wait_event.set()
logger.warning(msg)
finally:
wait_event.set()