File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222
2323import colorama
2424import pykwalify
25+
26+ try :
27+ from yaml import CSafeLoader as SafeLoader
28+ except ImportError :
29+ from yaml import SafeLoader # type: ignore
30+
2531import yaml
2632
2733from west .configuration import Configuration
@@ -649,7 +655,7 @@ def _ext_specs(project):
649655 # Load the spec file and check the schema.
650656 with open (spec_file ) as f :
651657 try :
652- commands_spec = yaml .safe_load (f .read ())
658+ commands_spec = yaml .load (f .read (), Loader = SafeLoader )
653659 except yaml .YAMLError as e :
654660 raise ExtensionCommandError from e
655661 try :
Original file line number Diff line number Diff line change 2222
2323import pykwalify .core
2424import yaml
25+
26+ try :
27+ from yaml import CSafeLoader as SafeLoader
28+ except ImportError :
29+ from yaml import SafeLoader # type: ignore
30+
2531from packaging .version import parse as parse_version
2632
2733from west import util
@@ -204,7 +210,7 @@ def _is_yml(path: PathType) -> bool:
204210
205211def _load (data : str ) -> Any :
206212 try :
207- return yaml .safe_load (data )
213+ return yaml .load (data , Loader = SafeLoader )
208214 except yaml .scanner .ScannerError as e :
209215 raise MalformedManifest (data ) from e
210216
You can’t perform that action at this time.
0 commit comments