Skip to content

Commit 5b918af

Browse files
committed
Explicitly wrap non-serializable values in json dump
1 parent 759ed8c commit 5b918af

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGES.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
4343
method so that the generated function argument list matches the function's
4444
prototype when including a header file.
4545

46+
From Thaddeus Crews:
47+
- Explicitly wrap non-serializable values in json dump
48+
4649
From William Deegan:
4750
- Fix sphinx config to handle SCons versions with post such as: 4.6.0.post1
4851

@@ -1437,12 +1440,12 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700
14371440
scons: rebuilding `file3' because:
14381441
the dependency order changed:
14391442
->Sources
1440-
Old:xxx New:zzz
1441-
Old:yyy New:yyy
1442-
Old:zzz New:xxx
1443+
Old:xxx New:zzz
1444+
Old:yyy New:yyy
1445+
Old:zzz New:xxx
14431446
->Depends
14441447
->Implicit
1445-
Old:/usr/bin/python New:/usr/bin/python
1448+
Old:/usr/bin/python New:/usr/bin/python
14461449
- Fix Issue #3350 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError.
14471450
- Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file
14481451
is generated. This was causing the > 1th target to not have it's implicit list cleared when the source

RELEASE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ IMPROVEMENTS
7575
- The NewParallel scheduler now only adds threads as new work requiring execution
7676
is discovered, up to the limit set by -j. This should reduce resource utilization
7777
when the achievable parallelism in the DAG is less than the -j limit.
78+
- Dumping an environment with `json` formatting will now explicitly specify if a given
79+
value cannot be serialized.
7880

7981

8082
PACKAGING

SCons/Environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ def Dump(self, key=None, format: str='pretty'):
17081708
elif fmt == 'json':
17091709
import json
17101710
def non_serializable(obj):
1711-
return str(type(obj).__qualname__)
1711+
return '<<non-serializable: %s>>' % type(obj).__qualname__
17121712
return json.dumps(cvars, indent=4, default=non_serializable)
17131713
else:
17141714
raise ValueError("Unsupported serialization format: %s." % fmt)

0 commit comments

Comments
 (0)