Skip to content

[Bug] Ignore_Errors does not support inheritance #4

Closed
@caffeine-addictt

Description

@caffeine-addictt

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)

  1. make a function which raises an exception
  2. initialize a Thread() with ignore_exceptions = [Exception]
  3. start the thread
  4. 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

Metadata

Metadata

Labels

Priority: High +Task is considered higher-priority.Status: WIPCurrently being worked on.Type: BugSomething isn't working as expected.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions