Skip to content

Commit

Permalink
Add PYTHONPATH in environment when using sys.executable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Jul 16, 2014
1 parent 5531d80 commit 48ab843
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions zest/releaser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,18 @@ def prepare_documentation_entrypoint(data):

def system(command, input=''):
"""commands.getoutput() replacement that also works on windows"""
#print "CMD: %r" % command
# print "CMD: %r" % command
if command.startswith(sys.executable):
env = {'PYTHONPATH': os.pathsep.join(sys.path)}
else:
env = None
p = subprocess.Popen(command,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
close_fds=MUST_CLOSE_FDS)
close_fds=MUST_CLOSE_FDS,
env=env)
i, o, e = (p.stdin, p.stdout, p.stderr)
if input:
i.write(input)
Expand Down

0 comments on commit 48ab843

Please sign in to comment.