Fix imports
Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
#
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
@@ -1,9 +1,10 @@
|
||||
#
|
||||
# Copyright(c) 2020-2021 Intel Corporation
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
import concurrent
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
|
||||
def start_async_func(func, *args):
|
||||
@@ -14,5 +15,5 @@ def start_async_func(func, *args):
|
||||
- done() method returns True when task ended (have a result or ended with an exception)
|
||||
otherwise returns False
|
||||
"""
|
||||
executor = concurrent.futures.ThreadPoolExecutor()
|
||||
executor = ThreadPoolExecutor()
|
||||
return executor.submit(func, *args)
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#
|
||||
# Copyright(c) 2019-2021 Intel Corporation
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#
|
||||
# Copyright(c) 2021 Intel Corporation
|
||||
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
@@ -33,7 +34,7 @@ class Retry:
|
||||
try:
|
||||
result = func()
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
cls.run_while_false(wrapped_func, retries=retries, timeout=timeout)
|
||||
|
Reference in New Issue
Block a user