Closed
Description
Bug report
Your issue may already be reported!
Please check out our active issues before creating one.
Expected Behavior
As laid out in the docs, initializing Thread() with ignore_errors = [Exception] should have ignored all exceptions
Current Behavior
Currently, initializing Thread() with ignore_errors = [Exception] does not ignore all exceptions
Is this a regression?
No
Possible Solution
Steps to Reproduce (for bugs)
- make a function which raises an exception
- initialize a Thread() with ignore_exceptions = [Exception]
- start the thread
- unexpected behavior occurs
Context
Code Snippet:
from thread import Thread
def myFunction(x=False) -> str:
raise RuntimeError()
newThread = Thread(
target = myFunction,
ignore_errors = [Exception]
)
newThread.start()
newThread.join()
Traceback:
Traceback (most recent call last):
File "/main.py", line 12, in <module>
newThread.join()
File "/thread/thread.py", line 208, in join
self._handle_exceptions()
File "/thread/thread.py", line 143, in _handle_exceptions
raise e
File "/thread/thread.py", line 108, in wrapper
self.returned_value = target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/main.py", line 4, in myFunction
raise RuntimeError()
RuntimeError
Your Environment
- Version used: 0.0.1
- Operating System and version (desktop or mobile): Linux
- Python version: 3.11.6