Skip to content

Commit

Permalink
pylint: Fix consider-using-dict-items
Browse files Browse the repository at this point in the history
Pylint 2.9 introduced new checker:
> Emitted when iterating over the keys of a dictionary and accessing the
  value by index lookup. Both the key and value can be accessed by
  iterating using the .items() method of the dictionary instead.

See pylint-dev/pylint#3389

Fixes: fleet-commander#279
Signed-off-by: Stanislav Levin <slev@altlinux.org>
  • Loading branch information
stanislavlevin committed Feb 17, 2022
1 parent a6bcc46 commit 133a11b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions logger/fleet_commander_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,7 @@ def _preferences_file_updated(self, monitor, fileobj, otherfile, eventType):
self.monitored_preferences[path] = prefs
else:
logger.debug("New preferences loaded. Checking for changes")
for preference in prefs:
value = prefs[preference]
for preference, value in prefs.items():
if preference in self.monitored_preferences[path]:
prev = self.monitored_preferences[path][preference]
logger.debug(
Expand Down

0 comments on commit 133a11b

Please sign in to comment.