py3: fix exception catching from 96128b8.