diff options
author | maiphi <39464783+maiphi@users.noreply.github.com> | 2018-05-20 17:42:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-20 17:42:52 (GMT) |
commit | 14c4bbd1d9e5f87a7964fd69a60e7d21d69319ea (patch) | |
tree | 906a92158dd0868bb968fa94e36777cebdffee4e /src | |
parent | 5efd04aaed4c9700a606e11733656225c5d933e8 (diff) | |
download | SCons-14c4bbd1d9e5f87a7964fd69a60e7d21d69319ea.zip SCons-14c4bbd1d9e5f87a7964fd69a60e7d21d69319ea.tar.gz SCons-14c4bbd1d9e5f87a7964fd69a60e7d21d69319ea.tar.bz2 |
Make class SCons.Subst.Literal hashable
When using Python 3, substitution of Literal objects requires the objects to be hashable, otherwise an error will be thrown. The hash value is that of the lstr member.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Subst.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 68d247f..0b4190b 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -86,6 +86,9 @@ class Literal(object): def __neq__(self, other): return not self.__eq__(other) + def __hash__(self): + return hash(self.lstr) + class SpecialAttrWrapper(object): """This is a wrapper for what we call a 'Node special attribute.' This is any of the attributes of a Node that we can reference from |