From ca7f042cccdf72e29881e8e92b81242b8c5bd503 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 27 Sep 2023 11:20:10 +0200 Subject: [PATCH] We shouldn't call dateutil.parser if t has already been deserialized to a datetime. --- platypush/plugins/rss/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/rss/__init__.py b/platypush/plugins/rss/__init__.py index 1ef908c7c8..1db8b34ee0 100644 --- a/platypush/plugins/rss/__init__.py +++ b/platypush/plugins/rss/__init__.py @@ -82,7 +82,9 @@ class RssPlugin(RunnablePlugin): t = var.get(varname) if t: - return dateutil.parser.isoparse(t) + if not isinstance(t, datetime.datetime): + t = dateutil.parser.isoparse(t) + return t return None