We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 869e41b commit 6242fa5Copy full SHA for 6242fa5
1 file changed
.github/scripts/sync_params.py
@@ -363,12 +363,16 @@ def _render_inline_yaml_value(value: Any) -> str:
363
def _render_yaml_value(value: Any) -> str:
364
"""Render *value* as YAML, preserving its natural round-trip style.
365
366
+ Uses a fresh YAML instance to avoid mutating the global ``_YAML_RT`` state.
367
+
368
Example:
369
value = 42
370
returns "42"
371
"""
372
+ y = YAML()
373
+ y.default_flow_style = None
374
stream = io.StringIO()
- _YAML_RT.dump(value, stream)
375
+ y.dump(value, stream)
376
# ruamel appends "\n...\n" (YAML document-end marker) when dumping bare scalars;
377
# strip it so the output stays on a single line for scalar values.
378
return stream.getvalue().rstrip("\n").removesuffix("\n...")
0 commit comments