update __init__.py for compability with python3

Error exception should be defined as
 "except Exception as e:" for compability with version 3+ of python.