Skip to content

Commit

Permalink
Improve error message when extension is not found (#795)
Browse files Browse the repository at this point in the history
* Improve error message when extension is not found
  • Loading branch information
mthrok authored May 27, 2020
1 parent 81d32c1 commit 3fbe4da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchtext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _init_extension():
extfinder = importlib.machinery.FileFinder(lib_dir, loader_details)
ext_specs = extfinder.find_spec("_torchtext")
if ext_specs is None:
raise ImportError
raise ImportError("torchtext C++ Extension is not found.")
torch.ops.load_library(ext_specs.origin)
torch.classes.load_library(ext_specs.origin)

Expand Down

0 comments on commit 3fbe4da

Please sign in to comment.