Build a completely new environment for the sub-process.

This commit is contained in:
Alberth
2015-01-16 21:31:09 +01:00
parent 572464fb71
commit 1bed5b2061

View File

@@ -58,8 +58,12 @@ def get_langfile_rev(name, rev):
@return: Lines wit string names. @return: Lines wit string names.
@rtype: C{list} of C{str} @rtype: C{list} of C{str}
""" """
# Copy the environment, and add HGPLAIN
env = dict(kv for kv in os.environ.items())
env['HGPLAIN'] = ''
cmd = ['hg', 'cat', '-r', rev, name] cmd = ['hg', 'cat', '-r', rev, name]
txt = subprocess.check_output(cmd, universal_newlines=True, env={'HGPLAIN':''}) txt = subprocess.check_output(cmd, universal_newlines=True, env=env)
lines = [] lines = []
for line in txt.split('\n'): for line in txt.split('\n'):