Prefix the 'safe_wrapper' function to be '_safe_wrapper'
This function should be hidden from public usage by prefixing it with an underscore since this really is an internal impl. detail and should be treated as such. Change-Id: I3b1d6c73556d22de19923ca273a6dfc9c9b77e97
This commit is contained in:
parent
1e172dae3b
commit
a0e4178a0d
|
@ -46,7 +46,9 @@ class LoopingCallDone(Exception):
|
|||
self.retvalue = retvalue
|
||||
|
||||
|
||||
def safe_wrapper(f, kind):
|
||||
def _safe_wrapper(f, kind):
|
||||
"""Wrapper that calls into wrapped function and logs errors as needed."""
|
||||
|
||||
def func(*args, **kwargs):
|
||||
try:
|
||||
return f(*args, **kwargs)
|
||||
|
@ -98,8 +100,7 @@ class LoopingCallBase(object):
|
|||
|
||||
def _run_loop(self, kind, event, idle_for_func,
|
||||
initial_delay=None, stop_on_exception=True):
|
||||
func = self.f if stop_on_exception else safe_wrapper(self.f, kind)
|
||||
|
||||
func = self.f if stop_on_exception else _safe_wrapper(self.f, kind)
|
||||
if initial_delay:
|
||||
greenthread.sleep(initial_delay)
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue