New approach for work with exceptions.

New approach for work with exceptions and move to Python 3.4.