env.PrependENVPath/AppendENVPath 没有按预期工作:

env.PrependENVPath/AppendENVPath doesnt' work as expected:

我安装了nodejs,希望给scons添加bin目录:

import os
env=Environment()
env.PrependENVPath('PATH','/home/my/node/bin')
print "PATH is", env.subst('$PATH')

运行 scons,它打印:

PATH is Well no value is printed. Why is that?

更改为以下内容以查看您的 PrependEnvPath 的结果

import os
env=Environment()
env.PrependENVPath('PATH','/home/my/node/bin')
print("PATH is", env['ENV']['$PATH'])

产量:

$ scons.py
scons: Reading SConscript files ...
PATH is:/home/my/node/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.