python 3 support in guard.py file