sns module: add backward-compatible support for Python 3.3+

All tests passed. Also adjusted integration test because it already failed on Python 2.
Line length (PEP8)