metadata: use yaml C implementation when available

This is an order of magnitude faster. Requires the C yaml bindings to be
installed.

Fixes fdroid/fdroidserver#716
This commit is contained in:
Marcus Hoffmann 2019-12-23 01:08:45 +01:00
parent 44694a0bc7
commit 01d00d54ca

View file

@ -27,6 +27,10 @@ import logging
import textwrap
import io
import yaml
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
import importlib
from collections import OrderedDict
@ -1070,7 +1074,7 @@ def parse_json_metadata(mf, app):
def parse_yaml_metadata(mf, app):
yamldata = yaml.safe_load(mf)
yamldata = yaml.load(mf, Loader=SafeLoader)
deprecated_in_yaml = ['Provides']