def append_results(results, function, *args, **kwargs):
"""
Calls *function* with the given *args* and *kwargs* then appends the result
to *results* (which must be a list). If we're not in the main process the
given *function* will be called using `safe_call`.
"""
if os.getpid() != PID:
results.append(safe_call(function, *args, **kwargs))
else:
results.append(function(*args, **kwargs))
评论列表
文章目录