From a4cdaf0bed2a4d66d727eca067ddf3f719398750 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:01:32 +0000 Subject: [PATCH] Remove assert statement from non-test files --- src/run_async.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/run_async.py b/src/run_async.py index 336e042b..3cd7dd44 100644 --- a/src/run_async.py +++ b/src/run_async.py @@ -29,7 +29,8 @@ from .modules.utils import buglog class RunAsync(threading.Thread): def __init__(self, task_func, callback=None, *args, **kwargs): self.source_id = None - assert threading.current_thread() is threading.main_thread() + if threading.current_thread() is not threading.main_thread(): + raise AssertionError super(RunAsync, self).__init__( target=self.target, args=args, kwargs=kwargs)