2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-23 02:16:01 +01:00

More cleanup for #1865

This commit is contained in:
Thomas Nagy 2016-11-26 14:22:30 +01:00
parent aa88cd86a5
commit 283e7953cb
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA

View File

@ -582,7 +582,13 @@ def h_fun(fun):
except AttributeError:
if isinstance(fun, functools.partial):
code = list(fun.args)
code.extend(fun.keywords.items())
# The method items() provides a sequence of tuples where the first element
# represents an optional argument of the partial function application
#
# The sorting result outcome will be consistent because:
# 1. tuples are compared in order of their elements
# 2. optional argument namess are unique
code.extend(sorted(fun.keywords.items()))
code.append(h_fun(fun.func))
fun.code = h_list(code)
return fun.code