mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-28 10:09:21 +00:00
Fixed the print statement to include path as well
This commit is contained in:
@@ -257,11 +257,11 @@ def get_crew(crew_path: str = "crew.py", require: bool = False) -> Crew | None:
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
for root, _, files in os.walk("."):
|
for root, _, files in os.walk("."):
|
||||||
if "crew.py" in files:
|
if crew_path in files:
|
||||||
crew_path = os.path.join(root, "crew.py")
|
crew_os_path = os.path.join(root, crew_path)
|
||||||
try:
|
try:
|
||||||
spec = importlib.util.spec_from_file_location(
|
spec = importlib.util.spec_from_file_location(
|
||||||
"crew_module", crew_path
|
"crew_module", crew_os_path
|
||||||
)
|
)
|
||||||
if not spec or not spec.loader:
|
if not spec or not spec.loader:
|
||||||
continue
|
continue
|
||||||
@@ -275,7 +275,7 @@ def get_crew(crew_path: str = "crew.py", require: bool = False) -> Crew | None:
|
|||||||
try:
|
try:
|
||||||
if isinstance(attr, Crew) and hasattr(attr, "kickoff"):
|
if isinstance(attr, Crew) and hasattr(attr, "kickoff"):
|
||||||
print(
|
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
|
return attr
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user