From 89678e05656c149e2e79d8ab09721059724fa8a0 Mon Sep 17 00:00:00 2001 From: halcy Date: Fri, 25 Nov 2022 00:09:54 +0200 Subject: Fix tests --- mastodon/Mastodon.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'mastodon') diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index d0b3606..6a783b4 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -3647,11 +3647,8 @@ class Mastodon: else: json_object[k] = dateutil.parser.parse(v) except: - if isinstance(v, str) and len(v.strip()) == 0: - # Pleroma bug workaround: Empty string becomes start of epoch - json_object[k] = datetime.datetime.fromtimestamp(0) - else: - raise MastodonAPIError('Encountered invalid date.') + # When we can't parse a date, we just leave the field out + del json_object[k] return json_object @staticmethod -- cgit v1.2.3