Don't break on empty stack

pull/453/head
Jérôme Alet 3 years ago
parent 2f423117c1
commit d82e291688
No known key found for this signature in database
GPG Key ID: 68097456F2A988D8

@ -84,7 +84,8 @@ def check(conf, token, prev, next, nextnext, context):
elif isinstance(token, (yaml.BlockEndToken,
yaml.FlowMappingEndToken,
yaml.FlowSequenceEndToken)):
context['stack'].pop()
if len(context['stack']) > 0:
context['stack'].pop()
elif (isinstance(token, yaml.KeyToken) and
isinstance(next, yaml.ScalarToken)):
# This check is done because KeyTokens can be found inside flow

Loading…
Cancel
Save