From b5e75793e108a72e6258b11df698f089afe1d2dd Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 3 Jun 2019 09:41:33 +0200 Subject: [PATCH] Fix validation infinite loop with empty platform block (#598) * Fix validation infinite loop with empty platform block * Update util.py --- esphome/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/util.py b/esphome/util.py index bad660cd5a..0ae0b9e32e 100644 --- a/esphome/util.py +++ b/esphome/util.py @@ -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)