--- mastodon/Mastodon.py 2019-05-31 07:36:22.000000000 -0500
+++ mastodon/Mastodon.py 2019-06-12 13:23:58.611843729 -0500
@@ -36,7 +36,12 @@
import base64
import json
-import blurhash
+
+IMPL_HAS_BLURHASH = True
+try:
+ import blurhash
+except:
+ IMPL_HAS_BLURHASH = False
try:
from urllib.parse import urlparse
--- mastodon/Mastodon.py~ 2019-06-12 13:29:46.000000000 -0500
+++ mastodon/Mastodon.py 2019-06-12 13:34:31.368519954 -0500
@@ -2390,6 +2390,9 @@
For further info and tips for advanced usage, refer to the documentation for the
blurhash module: https://github.com/halcy/blurhash-python
"""
+ if not IMPL_HAS_BLURHASH:
+ raise NotImplementedError('To use the blurhash functions, please install the blurhash python module.')
+
# Figure out what size to decode to
decode_components_x, decode_components_y = blurhash.components(media_dict["blurhash"])
if size_per_component == False: