From 1fa19ef5eeb2b37c54d291a5aa5858b7b91bbb5d Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Mon, 22 Jun 2020 15:10:43 -0400 Subject: Add support for overriding the default hash format This change adds support for a new --hash-format parameter that can be used to override the default hash format used by SCons. The default remains MD5, but this allows consumers to opt into SHA1, SHA256, or any other hash algorithm offered by their implementation of hashlib. --- SCons/Environment.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'SCons/Environment.py') diff --git a/SCons/Environment.py b/SCons/Environment.py index bb57e37c3..8e2b51b06 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -1492,10 +1492,8 @@ class Base(SubstitutionEnvironment): def Decider(self, function): copy_function = self._copy2_from_cache if function in ('MD5', 'content'): - if not SCons.Util.md5: - raise UserError("MD5 signatures are not available in this version of Python.") function = self._changed_content - elif function == 'MD5-timestamp': + elif function == ('MD5-timestamp', 'content-timestamp'): function = self._changed_timestamp_then_content elif function in ('timestamp-newer', 'make'): function = self._changed_timestamp_newer -- cgit v1.2.1