1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 22:40:12 +01:00

Support ruamel from Debian stretch

This commit is contained in:
Jochen Sprickerhof 2021-08-14 12:44:41 +02:00 committed by Jochen Sprickerhof
parent 52eeb21763
commit 28098c32e3

View File

@ -982,9 +982,12 @@ def write_yaml(mf, app):
return builds
yaml_app = _app_to_yaml(app)
yaml = ruamel.yaml.YAML()
yaml.indent(mapping=4, sequence=4, offset=2)
yaml.dump(yaml_app, stream=mf)
try:
yaml = ruamel.yaml.YAML()
yaml.indent(mapping=4, sequence=4, offset=2)
yaml.dump(yaml_app, stream=mf)
except AttributeError: # Debian/stretch's version does not have YAML()
ruamel.yaml.round_trip_dump(yaml_app, mf, indent=4, block_seq_indent=2)
build_line_sep = re.compile(r'(?<!\\),')