Update to `except ... as ...` syntax for Python 3.