PY3: py2/3 compat exception handling