Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #31 from bretthoerner/fix-env
Browse files Browse the repository at this point in the history
Fix env argument. Dicts are mutable and update returns None.
  • Loading branch information
Kenneth Reitz committed May 9, 2012
2 parents f262532 + e795586 commit 1608164
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions envoy/core.py
Expand Up @@ -29,7 +29,8 @@ def __init__(self, cmd):

def run(self, data, timeout, kill_timeout, env):
self.data = data
environ = dict(os.environ).update(env or {})
environ = dict(os.environ)
environ.update(env or {})

def target():

Expand Down Expand Up @@ -194,7 +195,8 @@ def connect(command, data=None, env=None):

# TODO: support piped commands
command_str = expand_args(command).pop()
environ = dict(os.environ).update(env or {})
environ = dict(os.environ)
environ.update(env or {})

process = subprocess.Popen(command_str,
universal_newlines=True,
Expand Down

0 comments on commit 1608164

Please sign in to comment.