compat: use "except <exception> as <var>" for python3 compat

Signed-off-by: David Aguilar <davvid@gmail.com>