Adds compatibility to exception handling

This changes all instances of the phrase "Exception, error" to
"Exception as error" for py3 compatibility.