fix python 3 build; right way to test exception is raised