typemap logic extension
python typemap: respect errors from iterators. Avoids peculiar crash.