Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion qtapputils/managers/taskmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ def __init__(self):
def _get_method(self, task: str):
# Try direct, then fallback to underscore-prefixed (for backward
# compatibility with older version of qtapputils).
return getattr(self, task, getattr(self, '_' + task))
try:
method = getattr(self, task)
except AttributeError:
method = getattr(self, '_' + task)
return method

def add_task(self, task_uuid4: Any, task: str, *args, **kargs):
"""
Expand Down
2 changes: 1 addition & 1 deletion qtapputils/managers/tests/test_taskmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _set_something(index, value):
DATA[index] = value

worker = WorkerBase()
worker._get_something = _get_something
worker.get_something = _get_something
worker._set_something = _set_something
return worker

Expand Down
Loading