Re: Subst should not stringify a callable if it didn't match the arguments

Mathew Robinson <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAFvD1Y7BxDPSv2WHS+xgLgoqtjrLMv5iObcYrLeOPwv0GH9xLg@mail.gmail.com>
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

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.