Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix find_spec for old finders that don't implement it. #86

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion numba_cuda/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.17
0.0.17.1
12 changes: 9 additions & 3 deletions site-packages/_numba_cuda_redirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@ def find_spec(self, name, path, target=None):
oot_path = [p.replace(self.numba_path, self.numba_cuda_path)
for p in path]
for finder in sys.meta_path:
spec = finder.find_spec(name, oot_path, target)
if spec is not None:
return spec
try:
spec = finder.find_spec(name, oot_path, target)
except AttributeError:
# Finders written to a pre-Python 3.4 spec for finders will
# not implement find_spec. We can skip those altogether.
continue
else:
if spec is not None:
return spec


finder = NumbaCudaFinder()
Expand Down
Loading