Skip to content

Commit

Permalink
Restrict namespace redirect error to ModuleNotFoundError
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Jun 21, 2022
1 parent 5e43989 commit 6ba893a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qiskit/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ def find_spec(self, fullname, path=None, target=None):
return importlib.util.spec_from_loader(
fullname, QiskitLoader(self.new_package, self.old_namespace), origin="qiskit"
)
except Exception: # pylint: disable=broad-except
except ModuleNotFoundError: # pylint: disable=broad-except
return None
return None

0 comments on commit 6ba893a

Please sign in to comment.