Skip to content

Commit

Permalink
Update importer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cobycloud committed Dec 24, 2024
1 parent 51f0fc4 commit 4abd113
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgs/swarmauri/swarmauri/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ def find_spec(self, fullname, path, target=None):
if parent and parent not in sys.modules:
print(f"Parent module '{parent}' not found. Cannot create namespace module: {fullname}")
return None

# Check if the module is an expected namespace component
if fullname not in REGISTRY and fullname.count(".") > 1:
print(f"Invalid namespace module: {fullname}")
return None

print(f"Creating placeholder for namespace module: {fullname}")
spec = ModuleSpec(fullname, self)
Expand Down

0 comments on commit 4abd113

Please sign in to comment.