Update utils.py

Working towards py3k support as its a major issue for my web application. Relates to mattupstate/flask-social#38