Use "monkeyYaml" in all environments

The "monkeyYaml" parser is intended to serve as a lightweight fallback
to Python's standard YAML parser in contexts where the latter is not
available. Any intentionally-simplified implementation will necessarily
exhibit non-standard behavior for different input, so not all input
accepted by the standard parser will be accepted by "monkeyYaml". If
loaded exclusively in fallback situations, these edge cases can only be
identified (and debugged) in the environments that require the fallback.
This has allowed developers to unknowingly author tests that cause
errors.

Update the test runner to use "monkeyYaml" in all cases, ensuring more
consistent behavior across contexts and precluding this class of
regression.
This commit is contained in:
Mike Pennisi 2015-07-01 14:35:13 -04:00
parent 1e80bf22f6
commit 1303ef0d05
1 changed files with 2 additions and 6 deletions

View File

@ -113,12 +113,8 @@ def importYamlLoad():
global yamlLoad
if yamlLoad:
return
try:
import yaml
yamlLoad = yaml.load
except:
monkeyYaml = loadMonkeyYaml()
yamlLoad = monkeyYaml.load
monkeyYaml = loadMonkeyYaml()
yamlLoad = monkeyYaml.load
def loadMonkeyYaml():
f = None