Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
else:
map_async = partial(pool.map_async, error_callback = error_callback)
result = map_async(func_star, izip(repeat(function),
iterable,
repeat(list(args)),
repeat(kwargs)),
chunksize = chunksize,
callback = callback)
except:
if close_pool:
pool.terminate()
raise
else:
if close_pool:
pool.close()
result = _ParallelAsyncResult(result, pool)
else:
result = _ParallelAsyncResult(result)
else:
values = _serial_map_or_starmap(function, iterable, args, kwargs,
False, map_or_starmap)
result = _DummyAsyncResult(values)
return result
result = map_async(func_star, izip(repeat(function),
iterable,
repeat(list(args)),
repeat(kwargs)),
chunksize = chunksize,
callback = callback)
except:
if close_pool:
pool.terminate()
raise
else:
if close_pool:
pool.close()
result = _ParallelAsyncResult(result, pool)
else:
result = _ParallelAsyncResult(result)
else:
values = _serial_map_or_starmap(function, iterable, args, kwargs,
False, map_or_starmap)
result = _DummyAsyncResult(values)
return result