[Scons-users] Subst should not stringify a callable if it didn't match the arguments

Mathew Robinson chasinglogic at gmail.com
Mon Mar 4 17:08:45 EST 2019


If you put this into a SConstruct file:

def a_bad_generator(target, source, env, for_signature):
    """Cause any kind of TypeError in this function."""
    5 + ’s’ # Raises a type error

env_vars = Variables()
env_vars.Add(
    'BAD_VAR',
    help="I'm going to behave unexpectedly",
    default=a_bad_generator,
)

env = Environment(
    variables=env_vars
)

print(env.subst('$BAD_VAR/repro_this_bug'))

And run scons you will see:


@homebase ➜  scons_repro scons
scons: Reading SConscript files ...
<function a_bad_generator at 0x107a53bf8>/repro_this_bug
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.
@homebase ➜  scons_repro

This is with version 3.0.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20190304/b1a51e9b/attachment.html>


More information about the Scons-users mailing list