Skip to content

Commit

Permalink
Log more info when failed to create py env
Browse files Browse the repository at this point in the history
  • Loading branch information
kagami-l committed May 21, 2024
1 parent 3f51b6c commit 8428005
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions devchat/workflow/env_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ def create(self, env_name: str, py_version: str) -> Tuple[bool, str]:
f"python={py_version}",
"-y",
]
with subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) as proc:
_, err = proc.communicate()
with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
out, err = proc.communicate()
msg = f"err: {err.decode()}\n-----\nout: {out.decode()}"

if proc.returncode != 0:
return False, err.decode("utf-8")

return False, msg
return True, ""

def remove(self, env_name: str) -> bool:
Expand Down

0 comments on commit 8428005

Please sign in to comment.