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