I am guessing that findNext
falls off the end without returning anything, which makes it automatically return None
. Kind of like this:
>>> def findNext(function):
... if function == 'y':
... return 'somestring',function[1:]
...
>>> function = 'x'
>>> print(findNext(function))
None
>>> temp, function = findNext(function)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not iterable
The solution would be to always return something.