diff options
author | William Deegan <bill@baddogconsulting.com> | 2016-12-22 23:23:50 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2016-12-22 23:23:50 (GMT) |
commit | 3ba8ac0c4c2b9c92e2b15a6623ad2181931b0e2f (patch) | |
tree | 05db761c3aa478e8dcd2c42f3bd5cf43857a394b /src/engine/SCons/Action.py | |
parent | 87c26bc0627fb528862f2a2dc4173074935f4290 (diff) | |
download | SCons-3ba8ac0c4c2b9c92e2b15a6623ad2181931b0e2f.zip SCons-3ba8ac0c4c2b9c92e2b15a6623ad2181931b0e2f.tar.gz SCons-3ba8ac0c4c2b9c92e2b15a6623ad2181931b0e2f.tar.bz2 |
Added some details comments to _function_contents() which is used to generate action signatures.
Diffstat (limited to 'src/engine/SCons/Action.py')
-rw-r--r-- | src/engine/SCons/Action.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index e0c8450..08e36c5 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -287,15 +287,24 @@ def _code_contents(code): def _function_contents(func): - """Return the signature contents of a function.""" + """Return the signature contents of a function. + + The signature is as follows (should be byte/chars): + ,( comma separated _object_contents for function argument defaults) + ,( comma separated _object_contents for any closure contents ) + + func.__code__ - Code object for function + func.__defaults__ - Tuple of function argument default values + func.__closure__ - + """ contents = [_code_contents(func.__code__)] # The function contents depends on the value of defaults arguments if func.__defaults__: - z = [str(_object_contents(cc)) for cc in func.__defaults__] + function_defaults_contents = [str(_object_contents(cc)) for cc in func.__defaults__] - contents.append(bytearray(',(','utf-8') + b','.join(z) + bytearray(')','utf-8')) + contents.append(bytearray(',(','utf-8') + b','.join(function_defaults_contents) + bytearray(')','utf-8')) else: contents.append(b',()') @@ -304,10 +313,10 @@ def _function_contents(func): #xxx = [_object_contents(x.cell_contents) for x in closure] try: - xxx = [_object_contents(x.cell_contents) for x in closure] + closure_contents = [_object_contents(x.cell_contents) for x in closure] except AttributeError: - xxx = [] - contents.append(b',(' + ','.join(xxx).encode('ascii') + b')') + closure_contents = [] + contents.append(b',(' + ','.join(closure_contents).encode('ascii') + b')') return bytearray('','utf-8').join(contents) |