File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,10 @@ def available_ringmodes(directory=None) -> Set[str]:
280280 is given the default data directory location is used.
281281
282282 Returns:
283- set: A set of possible ringmodes.
283+ set[str]: A set of possible ringmodes.
284+
285+ Raises:
286+ OSError: if no ringmodes can be found in the specified directory.
284287 """
285288 if directory is None :
286289 directory = Path (__file__ ).resolve ().parent / "data"
@@ -290,4 +293,6 @@ def available_ringmodes(directory=None) -> Set[str]:
290293 contents = os .listdir (directory_object .path )
291294 if ELEMENTS_FILENAME in contents and FAMILIES_FILENAME in contents :
292295 modes .add (directory_object .name )
296+ if not modes :
297+ raise OSError (f"No ringmodes found in { os .path .realpath (directory )} " )
293298 return modes
You can’t perform that action at this time.
0 commit comments