Use Python 3.x compatible syntax constructs

Avoid print operator, deprected except and
other things covered by statical checks.

Change-Id: I89f9608b977b2d4567300ec82558284dac347c9a
Merge "Use Python 3.x compatible syntax constructs"