Fix tracing on Python 3.