Skip to content

Commit

Permalink
Make subprocess inherit environment variables
Browse files Browse the repository at this point in the history
The PATH environment variable got unset for that subprocess,
thus not being able to find msgfmt.
  • Loading branch information
TomaSajt authored and Nick-Hall committed Feb 8, 2024
1 parent 163d88b commit d6a9b40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def merge(in_file, out_file, option, po_dir="po"):
"""
if not os.path.exists(out_file) and os.path.exists(in_file):
cmd = ["msgfmt", option, "--template", in_file, "-d", po_dir, "-o", out_file]
if subprocess.call(cmd, env={"GETTEXTDATADIR": po_dir}) != 0:
if subprocess.call(cmd, env={**os.environ, "GETTEXTDATADIR": po_dir}) != 0:
msg = "ERROR: %s was not merged into the translation files!\n" % out_file
raise SystemExit(msg)
_LOG.info("Compiling %s >> %s", in_file, out_file)
Expand Down

0 comments on commit d6a9b40

Please sign in to comment.