catching exceptions on python 3 and 2

http://python3porting.com/differences.html#except