Skip to content

Commit bd28aa0

Browse files
committed
fix message in value error raised when no paths are passed to a fileset (was previously access the fspaths of the object to do a repr)
1 parent ae86a7f commit bd28aa0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fileformats/core/fileset.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
else:
2424
from typing_extensions import TypeAlias
2525

26-
from fileformats.core.typing import Self
2726
from fileformats.core.converter_helpers import SubtypeVar
27+
from fileformats.core.typing import Self
2828
from fileformats.core.utils import _excluded_subpackages
2929

3030
from .classifier import Classifier
@@ -119,8 +119,6 @@ def __init__(
119119
metadata: ty.Optional[ty.Dict[str, ty.Any]] = None,
120120
**load_kwargs: ty.Any,
121121
):
122-
if not fspaths:
123-
raise ValueError("No file-system paths provided to FileSet")
124122
self._explicit_metadata = metadata
125123
self._load_kwargs = load_kwargs
126124
self._validate_class()
@@ -137,7 +135,7 @@ def __init__(
137135

138136
def _validate_fspaths(self) -> None:
139137
if not self.fspaths:
140-
raise ValueError(f"No file-system paths provided to {self}")
138+
raise ValueError(f"No file-system paths provided to {type(self)}")
141139
missing = [p for p in self.fspaths if not p or not p.exists()]
142140
if missing:
143141
missing_str = "\n".join(str(p) for p in missing)

0 commit comments

Comments
 (0)