File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ def copy_example(pack_example: str) -> Path:
7777
7878 Parameters
7979 ----------
80- example : str
80+ pack_example : str
8181 Pack and example name in the form ``<pack>/<exdir>``.
8282
8383 Returns
@@ -88,7 +88,7 @@ def copy_example(pack_example: str) -> Path:
8888 Raises
8989 ------
9090 ValueError
91- If the format is invalid.
91+ If the format is invalid (missing pack or example) .
9292 FileNotFoundError
9393 If the example directory does not exist.
9494 FileExistsError
@@ -97,6 +97,11 @@ def copy_example(pack_example: str) -> Path:
9797 if "/" not in pack_example :
9898 raise ValueError ("Example must be specified as <pack>/<exdir>" )
9999 pack , exdir = pack_example .split ("/" , 1 )
100+ if not pack or not exdir :
101+ raise ValueError (
102+ f"Invalid format for example '{ pack_example } '. "
103+ "Must be '<pack>/<exdir>'"
104+ )
100105 src = _get_examples_dir () / pack / exdir
101106 if not src .exists () or not src .is_dir ():
102107 raise FileNotFoundError (f"Example not found: { pack_example } " )
You can’t perform that action at this time.
0 commit comments