Skip to content

Commit 1303ef0

Browse files
committed
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.
1 parent 1e80bf2 commit 1303ef0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tools/packaging/parseTestRecord.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,8 @@ def importYamlLoad():
113113
global yamlLoad
114114
if yamlLoad:
115115
return
116-
try:
117-
import yaml
118-
yamlLoad = yaml.load
119-
except:
120-
monkeyYaml = loadMonkeyYaml()
121-
yamlLoad = monkeyYaml.load
116+
monkeyYaml = loadMonkeyYaml()
117+
yamlLoad = monkeyYaml.load
122118

123119
def loadMonkeyYaml():
124120
f = None

0 commit comments

Comments
 (0)