Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Py3k-friendly use of StringIO. Remove unused imports. #4

Merged
merged 1 commit into from
Jun 30, 2014

Conversation

kimgr
Copy link
Contributor

@kimgr kimgr commented Jun 30, 2014

This was done manually. Note that Python 2.7 has an io.StringIO class, but it's strictly Python3-compatible and deals in Unicode strings instead of bytes, so I preferred the classic cStringIO implementation for Python 2.

For the modules where StringIO was imported but not used, I just pruned them.

try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that when you get farther along with the Python 3 port, you'll end up using bytes instead of unicode/str for all the internal strings. I therefore predict you'll eventually change this to io.BytesIO. But we'll see what time brings :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a background thread worrying about that :-/

Once I get the syntax errors out of the way, we'll see how it goes. Thanks for the heads-up!

indygreg added a commit that referenced this pull request Jun 30, 2014
Py3k-friendly use of StringIO. Remove unused imports.
@indygreg indygreg merged commit cbf7708 into mozilla:master Jun 30, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants