next() wasn't available in Python 2.5; use .next() method instead.