Skip to content

Commit

Permalink
Fix client error for Python 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlucy-stripe committed Apr 8, 2019
1 parent a0f4a5d commit 6da9ddd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions basilica/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Supported Python versions: 2.7

Releases
========
- 0.2.6 : 04-08-2019
- Fixed PIL error detection in Python 2.
- 0.2.5 : 02-07-2019
- Added image resizing.
- 0.2.4 : 10-28-2018
Expand Down
2 changes: 2 additions & 0 deletions basilica/basilica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ def __encode_image(self, image, transform_image):
if transform_image:
try:
im = Image.open(io.BytesIO(image))
except IOError as e:
raise TypeError('`image` argument must be an image (`%s`)' % (str(e)))
except OSError as e:
raise TypeError('`image` argument must be an image (`%s`)' % (str(e)))
im.thumbnail((512, 512))
Expand Down
2 changes: 1 addition & 1 deletion basilica/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup

setup(name='basilica',
version='0.2.5',
version='0.2.6',
description='Client bindings for basilica.ai embeddings.',
long_description='Client bindings for basilica.ai embeddings.',
url='http://basilica.ai',
Expand Down

0 comments on commit 6da9ddd

Please sign in to comment.