Update convenience.py

python 3 support