💚 Fix tests on Python 3.7

Dictionaries are not reversible until 3.8.
This commit is contained in:
Gina Häußge committed 2023-01-17 16:55:10 +01:00
1 parent 20c1a408c4
commit f2ad1654a4
1 file changed
+5 -2
+5 -2
View File
@@ -563,11 +563,14 @@ class Settings:
map(lambda x: bool(self._deprecated_paths[tuple(prefix + [x])]), path[-1])
)
if tuple(path) not in self._deprecated_paths:
if (
tuple(path) not in self._deprecated_paths
or not self._deprecated_paths[tuple(path)]
):
return False
try:
return next(iter(reversed(self._deprecated_paths[tuple(path)].values())))
return list(self._deprecated_paths[tuple(path)].values())[-1]
except StopIteration:
return False