[Scons-users] Python 2.5 vs. Python 2.7

Rob Boehne robb at datalogics.com
Tue Jul 28 17:07:48 EDT 2015


Scons users,

I have inherited a large and old SCons build that is virtualenv'd to use Python 2.5 and scons 0.97.
I'm *trying* to get it to work in both python 2.5 and 2.7 before updating the version of scons (and other tools) that it uses.
Seems trivial, but alas.
The snippet below works in Python 2.5, but throws an error in Python 2.7 on the very last line:

# Exclude doclet into Tools jar
# See http://java.sun.com/j2se/javadoc/excludedoclet/docs/excludedoclet.html for documentation on this
docletenv = env.Clone(JAVACFLAGS='-classpath "$JDKROOT/lib/tools.jar"')
excludejava = docletenv.Java('$BUILDDIR/excludedoclet/classes', '#Tools/excludedoclet/src')
env['EXCLUDEDOCLET'] = docletenv.Jar('$BUILDDIR/Tools.jar', excludejava, JARCHDIR=excludejava[0].dir.path)


> scons
scons: Reading SConscript files ...
scons: Reading SConscript files ...

scons: *** attempted to add a non-Node as source of build\win-x86-32\Debug\Tools.jar:
        ['build\\win-x86-32\\Debug\\excludedoclet\\classes\\ExcludeDoclet.class'] is a <class 'SCons.Node.NodeList'>, not a Node
File "C:\Users\robb\Development\apdfl-win\DLE\SConstruct", line 1753, in <module>
Build completed with status 2

The difference is that the second line produces object "excludejava" as a UserList in Python 2.5, and produces a NodeList in python 2.7, both of length 1.

What would be the safest, most canonical way to rewrite these three lines to make it happy with both interpreters?

Thanks,

Robert Boehne
SCons novice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150728/6cb5652c/attachment.html>


More information about the Scons-users mailing list