Update try and except sintaxis to become python3 compatible

Signed-off-by: Álvaro Arranz <aarranz@conwet.com>