Updated utils.py

Made the change to utils.py backwards compatible with 2.* versions of Python