`io` module is present in Python 2.6

First import for `StringIO` must be from `io` module because this is the future. Fallback from `cStringIO` and finally from `StringIO` must be for Python 2.5 compatibility. If Python 2.5 is not supported then this `try .. except` block must be removed and only the import from `io` module should be left here.