Make example compatible with Python 2