Skip to content

Commit ffdbbfb

Browse files
committed
Explicit assert on spec object
1 parent f56b259 commit ffdbbfb

File tree

1 file changed

+3
-0
lines changed
  • src/torchcodec/decoders/_core

1 file changed

+3
-0
lines changed

src/torchcodec/decoders/_core/ops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ def load_torchcodec_extension():
3939
try:
4040
torch.ops.load_library(_get_extension_path(decoder_library_name))
4141
torch.ops.load_library(_get_extension_path(custom_ops_library_name))
42+
4243
spec = importlib.util.spec_from_file_location(
4344
pybind_ops_module_name,
4445
_get_extension_path(pybind_ops_library_name),
4546
)
47+
assert spec is not None
48+
4649
global _pybind_ops
4750
_pybind_ops = importlib.util.module_from_spec(spec)
4851
return

0 commit comments

Comments
 (0)