ADDED support for Python 3

- fixed exception handling syntax