applied the except and raise fixers to the master branch to close the gap with py3