Bug 1817815 - use double quotes for mach try presets, r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D170364
This commit is contained in:
Gijs Kruitbosch 2023-02-21 16:35:19 +00:00
parent c1d9c7e58c
commit 955b0ad251

View File

@ -10,6 +10,16 @@ import subprocess
import yaml
# Ensure strings with ' like fzf query strings get double-quoted:
def represent_str(self, data):
if "'" in data:
return self.represent_scalar("tag:yaml.org,2002:str", data, style='"')
return self.represent_scalar("tag:yaml.org,2002:str", data)
yaml.SafeDumper.add_representer(str, represent_str)
class PresetHandler:
def __init__(self, path):
self.path = path