Tidy python implementation
Tidy python implementation

1. Make it Python 3 compatible (exceptions no longer have `.message` on Python 3).
2. Make it pass the popular `pycodestyle` ("PEP 8") format
3. Comment on what `new=2` means
gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso,gautamkrishnar/tcso