Mercurial > public > mercurial-scm > hg-stable
diff tests/printenv.py @ 16982:9c892c830a72
tests/printenv.py: eliminate trailing spaces on output
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sun, 17 Jun 2012 00:27:31 +0200 |
parents | c19113e842d3 |
children | e7fdfc702d9f |
line wrap: on
line diff
--- a/tests/printenv.py Mon Jun 18 23:28:56 2012 +0200 +++ b/tests/printenv.py Sun Jun 17 00:27:31 2012 +0200 @@ -37,10 +37,12 @@ env.sort() out.write("%s hook: " % name) -for k, v in env: - if os.name == 'nt': - v = v.replace('\\', '/') - out.write("%s=%s " % (k, v)) +if os.name == 'nt': + filter = lambda x: x.replace('\\', '/') +else: + filter = lambda x: x +vars = ["%s=%s" % (k, filter(v)) for k, v in env] +out.write(" ".join(vars)) out.write("\n") out.close()