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 2dbb8c4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/vistir/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,11 @@ 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()}
for key, val in env.items():
_env[fs_encode(key)] = fs_encode(val)
_env = {fs_encode(k): fs_encode(v) for k, v in _env.items()}
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 2dbb8c4

Please sign in to comment.