fixed infinite loop
bug #455 fixed infinite loop (fabpot)

This PR was merged into the 5.1-dev branch.

Discussion
----------

fixed infinite loop

should fix #454

Commits
-------

d9ba6c0 fixed infinite loop