Skip to content

Commit 0ac90ba

Browse files
committed
Assert origin is there
1 parent b034fff commit 0ac90ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/torchcodec/_internally_replaced_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ def _get_extension_path(lib_name: str) -> str:
3232
)
3333
ext_specs = extfinder.find_spec(lib_name)
3434
if ext_specs is None:
35-
raise ImportError
35+
raise ImportError(f"No spec found for {lib_name}")
36+
37+
if ext_specs.origin is None:
38+
raise ImportError(f"Existing spec found for {lib_name} does not have an origin")
3639

3740
return ext_specs.origin
3841

0 commit comments

Comments
 (0)