Fixed the print statement to include path as well

This commit is contained in:
Vidit-Ostwal
2025-02-20 08:41:25 +05:30
parent b2cc85aef2
commit 3abeec0221

View File

@@ -257,11 +257,11 @@ def get_crew(crew_path: str = "crew.py", require: bool = False) -> Crew | None:
import os
for root, _, files in os.walk("."):
if "crew.py" in files:
crew_path = os.path.join(root, "crew.py")
if crew_path in files:
crew_os_path = os.path.join(root, crew_path)
try:
spec = importlib.util.spec_from_file_location(
"crew_module", crew_path
"crew_module", crew_os_path
)
if not spec or not spec.loader:
continue
@@ -275,7 +275,7 @@ def get_crew(crew_path: str = "crew.py", require: bool = False) -> Crew | None:
try:
if isinstance(attr, Crew) and hasattr(attr, "kickoff"):
print(
f"Found valid crew object in attribute '{attr_name}'."
f"Found valid crew object in attribute '{attr_name}' at {crew_os_path}."
)
return attr