Use Python 3.x compatible except construct

except x as y: works with any Python version >= 2.6
and is also compatible with Python 3.x.

Change-Id: Id795766ffaa7d6d3ec11c6cf8a0cd7e018bd1cba
Merge "Use Python 3.x compatible except construct"