python 3 compatibility

Had to futz with some things to make it work on recent gdb's that use python3

I think the `except Foo as bar` syntax works since python 2.6 or 2.7.. do you need to support anything before then?