Merge pull request #208 from limburgher/master

Try/catch magic for #207.
This commit is contained in:
Lorenz Diener 2020-02-15 13:51:59 +01:00 cometido por GitHub
commit 4e76f6e322
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 4AEE18F83AFDEB23

Veure arxiu

@ -3672,8 +3672,8 @@ class MastodonMalformedEventError(MastodonError):
def guess_type(media_file):
mime_type = None
if magic:
try:
mime_type = magic.from_file(media_file, mime=True)
else:
except AttributeError:
mime_type = mimetypes.guess_type(media_file)[0]
return mime_type