From 1a94d36177dc1ee1c2012900efec974fb0ff5fb0 Mon Sep 17 00:00:00 2001 From: mi-ac Date: Fri, 11 Feb 2022 14:52:31 +0100 Subject: [PATCH] Make monkeyYaml Python3 compatible Python2 allows ` < None` which evaluates to False. In Python3 this raises an exception. See: https://crbug.com/1296209 Initializing with 0 preserves the logic and works in both Python versions. --- src/_monkeyYaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_monkeyYaml.py b/src/_monkeyYaml.py index bc6d128..b988c43 100644 --- a/src/_monkeyYaml.py +++ b/src/_monkeyYaml.py @@ -69,7 +69,7 @@ def myMaybeList(value): def myMultilineList(lines, value): # assume no explcit indentor (otherwise have to parse value) value = [] - indent = None + indent = 0 while lines: line = lines.pop(0) leading = myLeadingSpaces(line)