If input to convert() doesn't have a write() member, then it must be str or bytes type

pull/110/head
parent 7c90b2c451
commit f94684c8ea

@ -1005,6 +1005,9 @@ def convert(*images, title=None,
try:
rawdata = img.read()
except AttributeError:
if not isinstance(img, (str, bytes)):
raise TypeError(
"Neither implements read() nor is str or bytes")
# the thing doesn't have a read() function, so try if we can treat
# it as a file name
try:

Loading…
Cancel
Save