Update debug.py

Python 3 support