summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-08-01 09:47:49 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2017-08-01 09:47:49 -0700
commit5f9a1b8311d637913ea21965501926d3fe762216 (patch)
tree180d9221d5aaaf78b23ecec5ed5c3f56a9882e1f
parentcd7001cfff39a23a6c671cb65e8ec699cecbfc95 (diff)
downloadscons-5f9a1b8311d637913ea21965501926d3fe762216.tar.gz
PY2/3 Fix more function signiture logic. Previously was dropping first co_consts under the mistaken belief that first item was always docstring. Shortcut logic for NoneType and strings.
-rw-r--r--src/engine/SCons/Action.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py
index 7f11d7bc..4449bea8 100644
--- a/src/engine/SCons/Action.py
+++ b/src/engine/SCons/Action.py
@@ -257,13 +257,7 @@ def _code_contents(code):
# function. Note that we have to call _object_contents on each
# constants because the code object of nested functions can
# show-up among the constants.
- #
- # Note that we also always ignore the first entry of co_consts
- # which contains the function doc string. We assume that the
- # function does not access its doc string.
- # NOTE: This is not necessarily true. If no docstring, then co_consts[0] does
- # have a string which is used.
- z = [_object_contents(cc) for cc in code.co_consts[1:]]
+ z = [_object_contents(cc) for cc in code.co_consts]
contents.extend(b',(')
contents.extend(bytearray(',', 'utf-8').join(z))
contents.extend(b')')
@@ -341,6 +335,11 @@ def _object_instance_content(obj):
"""
retval = bytearray()
+ if obj is None:
+ return b'N.'
+
+ if isinstance(obj, SCons.Util.BaseStringTypes):
+ return SCons.Util.to_bytes(obj)
inst_class = obj.__class__
inst_class_name = bytearray(obj.__class__.__name__,'utf-8')