We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c17cff commit 3909e91Copy full SHA for 3909e91
1 file changed
src/somesy/core/writer.py
@@ -45,9 +45,11 @@ def __init__(
45
else:
46
if self.create_if_not_exists:
47
self._init_new_file()
48
+ self._load()
49
50
raise FileNotFoundError(f"The file {self.path} does not exist.")
51
52
+ @abstractmethod
53
def _init_new_file(self) -> None:
54
"""Create an new suitable target file.
55
@@ -228,6 +230,8 @@ def _to_person(person_obj: Any) -> Person:
228
230
@classmethod
229
231
def _parse_people(cls, people: Optional[List[Any]]) -> List[Person]:
232
"""Return a list of Persons parsed from list of format-specific people representations."""
233
+ if not people:
234
+ return []
235
return list(map(cls._to_person, people or []))
236
237
# ----
0 commit comments