Update StringIO import for py3k
This commit is contained in:
parent
4f1e41a9e5
commit
c086449818
1 changed files with 6 additions and 1 deletions
|
|
@ -62,7 +62,12 @@ with a status update.
|
|||
# Assume you are working with a JPEG
|
||||
|
||||
from PIL import Image
|
||||
from StringIO import StringIO
|
||||
try:
|
||||
# Python 3
|
||||
from io import StringIO
|
||||
except ImportError:
|
||||
# Python 2
|
||||
from StringIO import StringIO
|
||||
|
||||
photo = Image.open('/path/to/file/image.jpg')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue