cleanup exception handling - use new exception hierarchy (since python 2.5)