small exception-handling change to support py3 (compatible with py2.6+)

Because you don't support python 2.5 and lower, you should use the new exception handling syntax, which also works on python 3.x.