**Describe the bug** Here's a sample SConstruct which demonstrates the issue. ```py env=Environment() if ARGUMENTS.get('dir', 0): env.Program('dir1/main/main','main.c') else: env.Program('dir1/main','main.c') ``` If you run as ``` scons # followed by scons dir=1 ``` Or the reverse You'll get a stack trace. **Required information** * Link to SCons Users thread discussing your issue. * * Version of SCons Any * Version of Python Any * Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc) Any * How you installed SCons N/A * What Platform are you on? (Linux/Windows and which version) N/A * How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. See description above * How you invoke scons (The command line you're using "scons --flags some_arguments") See description above