Fix imports

Signed-off-by: Katarzyna Treder <katarzyna.treder@h-partners.com>
This commit is contained in:
Katarzyna Treder
2024-12-13 15:18:42 +01:00
parent fd869a0afc
commit 5bd6a656c5
37 changed files with 170 additions and 231 deletions

View File

@@ -0,0 +1,4 @@
#
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

View File

@@ -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)

View File

@@ -1,5 +1,6 @@
#
# Copyright(c) 2019-2021 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

View File

@@ -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)