Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
#58: Make subprocess pass environment variables itself
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Nov 15, 2020
1 parent 7307f48 commit 575e9fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rkd/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def check_call(command: str, script_to_show: Optional[str] = '', use_subprocess:

process = subprocess.Popen(command, shell=True, stdin=replica_fd, stdout=replica_fd, stderr=replica_fd,
bufsize=64, close_fds=ON_POSIX, universal_newlines=False, preexec_fn=os.setsid,
cwd=cwd if cwd else os.getcwd(), env=env)
cwd=cwd if cwd else os.getcwd())

out_buffer = TextBuffer(buffer_size=1024 * 10)
fd_thread = Thread(target=push_output,
Expand Down
2 changes: 1 addition & 1 deletion src/rkd/taskutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def py(self, code: str = '', become: str = None, capture: bool = False,
return

if capture:
out = check_output(cmd + ' ' + arguments, shell=True, stdin=read, env=os.environ).decode('utf-8')
out = check_output(cmd + ' ' + arguments, shell=True, stdin=read).decode('utf-8')
os.unlink(py_temp_file.name) if py_temp_file else None

return out
Expand Down

0 comments on commit 575e9fd

Please sign in to comment.