re-added PY3 exception handling