Skip to content

Commit

Permalink
Use environment variables provided as an argument to run()
Browse files Browse the repository at this point in the history
Previously, they were accidentally being discarded during the encoding
step.

Resolves sarugaku#55
  • Loading branch information
JacobHenner committed Dec 14, 2018
1 parent 3c6b0f4 commit 695f0f2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/vistir/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,13 @@ def run(
_env = os.environ.copy()
if env:
_env.update(env)
env = _env
if six.PY2:
fs_encode = partial(to_bytes, encoding=locale_encoding)
_env = {fs_encode(k): fs_encode(v) for k, v in os.environ.items()}
_env = {fs_encode(k): fs_encode(v) for k, v in _env.items()}
for key, val in env.items():
_env[fs_encode(key)] = fs_encode(val)
else:
_env = {k: fs_str(v) for k, v in os.environ.items()}
_env = {k: fs_str(v) for k, v in _env.items()}
if not spinner_name:
spinner_name = "bouncingBar"
if six.PY2:
Expand Down

0 comments on commit 695f0f2

Please sign in to comment.