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:
Otto Winter 2019-06-03 09:41:33 +02:00 committed by GitHub
parent 734cc989de
commit b5e75793e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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