Skip to content

Commit

Permalink
Don't explode returned values in QgsTaskWrapper
Browse files Browse the repository at this point in the history
Breaks returning list values
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent f73f3c1 commit fded1a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions python/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,7 @@ def finished(self, result):

try:
if self.returned_values:
# we want to support singular returned values which are not iterable
if hasattr(self.returned_values, '__iter__'):
self.on_finished(result, *self.returned_values)
else:
self.on_finished(result, self.returned_values)
self.on_finished(result, self.returned_values)
else:
self.on_finished(result)
except Exception as ex:
Expand Down
6 changes: 3 additions & 3 deletions tests/src/python/test_qgstaskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def run_multiple_val_result(task):
return 5, 'whoo'


def finished_multiple_value_result(result, value, statement):
finished_multiple_value_result.value = value
finished_multiple_value_result.statement = statement
def finished_multiple_value_result(result, results):
finished_multiple_value_result.value = results[0]
finished_multiple_value_result.statement = results[1]
return


Expand Down

0 comments on commit fded1a1

Please sign in to comment.