summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-08-01 16:47:49 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-08-01 16:47:49 (GMT)
commit7d36c95312ee64c7c17b374999857a00518a53b8 (patch)
tree180d9221d5aaaf78b23ecec5ed5c3f56a9882e1f /src
parent7fa025432c147333167393d0b88edfe7266b2646 (diff)
downloadSCons-7d36c95312ee64c7c17b374999857a00518a53b8.zip
SCons-7d36c95312ee64c7c17b374999857a00518a53b8.tar.gz
SCons-7d36c95312ee64c7c17b374999857a00518a53b8.tar.bz2
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.
Diffstat (limited to 'src')
-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 7f11d7b..4449bea 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')