1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-13 22:28:14 +00:00

Fix validation infinite loop with empty platform block

This commit is contained in:
Otto Winter 2019-06-02 13:49:11 +02:00
parent f31c1480f3
commit 6c1024e9cb
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E

View File

@ -187,7 +187,9 @@ class OrderedDict(collections.OrderedDict):
def move_to_end(self, key, last=True):
if IS_PY2:
if last:
if len(self) == 1:
return
elif last:
# When moving to end, just pop and re-add
val = self.pop(key)
self[key] = val