[Scons-users] Node.FS get_path not working correctly?
Daniel Moody
dmoody256 at gmail.com
Mon May 28 00:18:56 EDT 2018
It seems if I use get path with a file this is outside of the base build
dir or I try to get a path relative to a dir that is in the base build dir,
get_path just returns the abspath?
The function comment seems to suggest it would be relative:
def get_path(self, dir=None):
"""Return path relative to the current working directory of the
Node.FS.Base object that owns us."""
Let SConstruct be:
import os
env = Environment()
test_file1_node = env.File(os.path.abspath('../outer/testFile1.txt'))
test_file2_node = env.File(os.path.abspath('./inner/testFile2.txt'))
test_file3_node = env.File(os.path.abspath('./inner2/testFile3.txt'))
print(test_file1_node.get_path())
print(test_file2_node.get_path())
print(test_file3_node.get_path('./inner2'))
I get this as output:
scons: Reading SConscript files ...
C:\Users\Daniel\workspace\test\outer\testFile1.txt
inner\testFile2.txt
C:\Users\Daniel\workspace\test\base\inner2\testFile3.txt
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.
Any ideas? I have a pull request to fix it if it is a bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180528/7f803b90/attachment-0001.html>
More information about the Scons-users
mailing list