Update convenience.py

Python 3 support