scikits-image/scikits-image — pull request #332 by cgohlke (2012-09-30 00:10:05+00:00)
Title: Use io.BytesIO instead of StringIO

Fixes NameError: global name 'io' is not defined on Python 3:

```
ERROR: test_pil.test_repr_png
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python32\lib\site-packages\nose\case.py", line 198, in runTest
self.test(*self.arg)
File "X:\Python32\lib\site-packages\numpy\testing\decorators.py", line 147, in skipper_func
return f(*args, **kwargs)
File "X:\Python32\lib\site-packages\skimage\io\tests\test_pil.py", line 86, in test_repr_png
original_img_str = original_img._repr_png_()
File "X:\Python32\lib\site-packages\skimage\io\_io.py", line 46, in _repr_png_
return self._repr_image_format('png')
File "X:\Python32\lib\site-packages\skimage\io\_io.py", line 52, in _repr_image_format
str_buffer = io.StringIO()
NameError: global name 'io' is not defined
```

This is because the following code breaks when run through the 2to3 tool:

```
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# snip
str_buffer = StringIO.StringIO()
```
After 2to3:
```
try:
import io as StringIO
except ImportError:
import io
# snip
str_buffer = io.StringIO()
```