Fix debug bug for py3