Skip to content

Commit a14261a

Browse files
committed
Use saneyaml in place of yaml
Signed-off-by: tdruez <[email protected]>
1 parent 1874789 commit a14261a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scanpipe/pipes/ort.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from dataclasses import field
2727
from pathlib import Path
2828

29-
import yaml
29+
import saneyaml
3030

3131

3232
@dataclass
@@ -63,7 +63,7 @@ class Project:
6363
@classmethod
6464
def from_yaml(cls, yaml_str: str):
6565
"""Create a Project object from a YAML string."""
66-
data = yaml.safe_load(yaml_str)
66+
data = saneyaml.load(yaml_str)
6767

6868
# Parse dependencies
6969
dependencies = [
@@ -93,7 +93,7 @@ def from_file(cls, filepath: str | Path):
9393

9494
def to_yaml(self) -> str:
9595
"""Dump the Project object back to a YAML string."""
96-
return yaml.safe_dump(asdict(self), sort_keys=False, allow_unicode=True)
96+
return saneyaml.dump(asdict(self))
9797

9898
def to_file(self, filepath: str | Path):
9999
"""Write the Project object to a YAML file."""

0 commit comments

Comments
 (0)