Use py3 compatible method for catching exceptions
Now ancient versions of python used to support catching exceptions in the form
except Exception, exception_object. This support was removed in py3 (and
introduced preemptively in earlier 2.x versions), being replaced by the form
except Exception as exception_object.