Skip to content

Commit 6819070

Browse files
committed
Try find_spec
1 parent f36d050 commit 6819070

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

src/torchcodec/decoders/_core/ops.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def load_torchcodec_extension():
4646
_get_extension_path(pybind_ops_library_name),
4747
)
4848
if spec is None:
49-
raise ImportError("Unable to load spec for pybind_ops")
49+
spec = importlib.util.find_spec(pybind_ops_module_name)
50+
if spec is None:
51+
raise ImportError("Unable to load spec for pybind_ops")
5052

5153
global _pybind_ops
5254
_pybind_ops = importlib.util.module_from_spec(spec)

0 commit comments

Comments
 (0)