Allow trace.py to work on python3