compatibility with python 3.x

using "as" keyword instead of comma in except statement
Merge pull request #166 from ivantchomgue/patch-2

compatibility with python 3.x