Improve Python 3.x compatibility

Some mechanical translation of the deprecated
except x,y construct. Should work with Python >= 2.6
just fine

Change-Id: I394f9956b9e3e3d9f5f1e9ad50c35b13200af2a1
Merge "Improve Python 3.x compatibility"