Issue 1382, hash randomization on python 3.3 causes reconfigurations

This commit is contained in:
Thomas Nagy 2013-11-28 20:00:50 +01:00
parent 1a2e877d33
commit ea549ae36e
3 changed files with 4 additions and 3 deletions

View File

@ -334,7 +334,7 @@ class ConfigurationContext(Context.Context):
:type node: :py:class:`waflib.Node.Node`
"""
super(ConfigurationContext, self).post_recurse(node)
self.hash = hash((self.hash, node.read('rb')))
self.hash = Utils.h_list((self.hash, node.read('rb')))
self.files.append(node.abspath())
def eval_rules(self, rules):

View File

@ -567,7 +567,7 @@ def autoconfigure(execute_method):
else:
h = 0
for f in env['files']:
h = hash((h, Utils.readf(f, 'rb')))
h = Utils.h_list((h, Utils.readf(f, 'rb')))
do_config = h != env.hash
if do_config:

View File

@ -478,7 +478,8 @@ def quote_define_name(s):
def h_list(lst):
"""
Hash lists. For tuples, using hash(tup) is much more efficient
Hash lists. For tuples, using hash(tup) is much more efficient,
except on python >= 3.3 where hash randomization assumes everybody is running a web application.
:param lst: list to hash
:type lst: list of strings