mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 22:14:54 +01:00
Fix validation infinite loop with empty platform block (#598)
* Fix validation infinite loop with empty platform block * Update util.py
This commit is contained in:
parent
c81e3a3be4
commit
6c564c7b7f
1 changed files with 2 additions and 0 deletions
|
@ -187,6 +187,8 @@ class OrderedDict(collections.OrderedDict):
|
|||
|
||||
def move_to_end(self, key, last=True):
|
||||
if IS_PY2:
|
||||
if len(self) == 1:
|
||||
return
|
||||
if last:
|
||||
# When moving to end, just pop and re-add
|
||||
val = self.pop(key)
|
||||
|
|
Loading…
Reference in a new issue