Merge branch 'fixbug/mgx-46' into 'mgx_ops'

fixbug: MGX-46

See merge request pub/MetaGPT!143
This commit is contained in:
林义章 2024-06-05 13:30:24 +00:00
commit f37b12a8ec
2 changed files with 8 additions and 1 deletions

View file

@ -496,7 +496,9 @@ class Engineer(Role):
filename = Path(i)
if filename.suffix != ".py":
continue
workdir = self.repo.srcs.workdir / filename.parent
workdir = self.src_workspace / filename.parent
if not workdir.exists():
workdir = self.project_repo.workdir / filename.parent
await init_python_folder(workdir)
async def _is_fixbug(self) -> bool:

View file

@ -896,6 +896,11 @@ def get_project_srcs_path(workdir: str | Path) -> Path:
async def init_python_folder(workdir: str | Path):
if not workdir:
return
workdir = Path(workdir)
if not workdir.exists():
return
init_filename = Path(workdir) / "__init__.py"
if init_filename.exists():
return