Remove unnecessary instances of dict.keys() (#42518)

This commit is contained in:
springstan authored and GitHub committed 2020-10-28 20:43:48 +01:00
1 parent 6e43d489ca
commit a967f689c7
21 files changed
+25 -25

No files matched your search

@@ -142,7 +142,7 @@ class FeedManager:
def _update_and_fire_entry(self, entry):
"""Update last_entry_timestamp and fire entry."""
# Check if the entry has a published date.
if "published_parsed" in entry.keys() and entry.published_parsed:
if "published_parsed" in entry and entry.published_parsed:
# We are lucky, `published_parsed` data available, let's make use of
# it to publish only new available entries since the last run
self._has_published_parsed = True
@@ -166,7 +166,7 @@ class FeedManager:
self._last_entry_timestamp = datetime.utcfromtimestamp(0).timetuple()
for entry in self._feed.entries:
if self._firstrun or (
"published_parsed" in entry.keys()
"published_parsed" in entry
and entry.published_parsed > self._last_entry_timestamp
):
self._update_and_fire_entry(entry)