Update 'except' syntax for 2.6+

Through Python 2.5, "except Exception, e" was the syntax for catching exceptions; from Python 2.6 onward, the syntax became "except Exception as e" (with both forms accepted before Python 3, but with the comma syntax deprecated). This pull request brings things into compatibility with the current versions of Python (2.6+ and 3+).