experiment: try to autocast when possible

This commit is contained in:
Romain Dorgueil
2018-07-16 12:53:15 +02:00
parent 71cd606fad
commit 5780b36480

View File

@ -285,10 +285,10 @@ class NodeExecutionContext(BaseContext, WithStatistics):
# Store or check input type # Store or check input type
if self._input_type is None: if self._input_type is None:
self._input_type = type(input_bag) self._input_type = type(input_bag)
elif type(input_bag) is not self._input_type: elif type(input_bag) != self._input_type:
try: try:
if type(self._input_type) == tuple: if self._input_type == tuple:
input_bag = self._input_type(tuple) input_bag = self._input_type(input_bag)
else: else:
input_bag = self._input_type(*input_bag) input_bag = self._input_type(*input_bag)
except Exception as exc: except Exception as exc: