From ec76c1aa8a4a5c1c92ab9926a54cb0b90e2a6407 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sat, 19 Aug 2017 14:15:12 +0300 Subject: [PATCH] utils: collect return value from map Zip it together with the targets list and return back to the caller so he can use it if he wants. Signed-off-by: Ruslan Kuprieiev --- dvc/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dvc/utils.py b/dvc/utils.py index bb4e8e11f..f2045f76b 100644 --- a/dvc/utils.py +++ b/dvc/utils.py @@ -68,8 +68,10 @@ def map_progress(func, targets, n_threads): p = ThreadPool(processes=n_threads) try: - p.map(func, targets) + ret = p.map(func, targets) except Exception as exc: Logger.error('Unexpected exception while processing targets: {}'.format(exc)) finally: progress.finish() + + return zip(targets, ret)