tests: use yaml.Loader on older yaml versions

This commit is contained in:
Marcus Hoffmann 2020-09-10 17:10:43 +02:00
parent 709f4c9b18
commit 89f63b3e1c
1 changed files with 7 additions and 1 deletions

View File

@ -29,7 +29,13 @@ except ImportError:
try:
from yaml import CFullLoader as FullLoader
except ImportError:
from yaml import FullLoader
try:
# FullLoader is available from PyYaml 5.1+, as we don't load user
# controlled data here, it's okay to fall back the unsafe older
# Loader
from yaml import FullLoader
except ImportError:
from yaml import Loader as FullLoader
localmodule = os.path.realpath(
os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '..'))