Skip to content

Commit a998627

Browse files
authored
Merge pull request SCons#4447 from StenGruener/sconscript_debug_fix
Fixing a bug with --debug=sconscript
2 parents 6facdff + 83eaacb commit a998627

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

CHANGES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ NOTE: The 4.0.0 Release of SCons dropped Python 2.7 Support
88
NOTE: 4.3.0 now requires Python 3.6.0 and above. Python 3.5.x is no longer supported
99

1010
RELEASE VERSION/DATE TO BE FILLED IN LATER
11-
1211
From Michał Górny:
1312
- Remove unecessary dependencies on pypi packages from setup.cfg
1413

14+
From Sten Grüner:
15+
- Fix of the --debug=sconscript option to return exist statements when using return
16+
statement with stop flag enabled
1517

1618
RELEASE 4.6.0 - Sun, 19 Nov 2023 17:22:20 -0700
1719

RELEASE.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
3232
FIXES
3333
-----
3434

35-
- List fixes of outright bugs
35+
- Fix of the --debug=sconscript option to return exist statements when using return
36+
statement with stop flag enabled
3637

3738
IMPROVEMENTS
3839
------------

SCons/Script/SConscript.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@ def _SConscript(fs, *files, **kw):
280280
if SCons.Debug.sconscript_trace:
281281
print("scons: Exiting "+str(scriptname))
282282
except SConscriptReturn:
283-
pass
283+
if SCons.Debug.sconscript_trace:
284+
print("scons: Exiting "+str(scriptname))
285+
else:
286+
pass
284287
finally:
285288
if Main.print_time:
286289
elapsed = time.perf_counter() - start_time

test/option/debug-sconscript.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@
5151
'scons: Exiting %s%sSConstruct' % (wpath, os.sep)
5252
]
5353
test.must_contain_all_lines(test.stdout(), expect)
54+
55+
# Ensure that reutrns with stop are handled properly
56+
57+
test.write('SConstruct', """\
58+
foo = "bar"
59+
Return("foo", stop=True)
60+
print("SConstruct")
61+
""")
62+
63+
test.run(arguments="--debug=sconscript .")
64+
test.must_contain_all_lines(test.stdout(), expect)
65+
5466
test.pass_test()
5567

5668
# Local Variables:

0 commit comments

Comments
 (0)