swf module: add backward-compatible support for Python 3.3+
Merge pull request #2397 from felixonmars/swf-py3

swf module: add backward-compatible support for Python 3.3+. Fixes #2397.