diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-04-06 16:34:44 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-04-06 16:34:44 (GMT) |
commit | 12826a83362d0da1abd16cb29edb38be48e8f172 (patch) | |
tree | dc9f72d4dbbf2cb50350e1b76e38011049a4a34f /src | |
parent | ab8f8b9186dbc9dc14580b00789a7c2aea0f1df9 (diff) | |
download | SCons-12826a83362d0da1abd16cb29edb38be48e8f172.zip SCons-12826a83362d0da1abd16cb29edb38be48e8f172.tar.gz SCons-12826a83362d0da1abd16cb29edb38be48e8f172.tar.bz2 |
py2/3 Need to add __hash__ function to EntryProxy as with py3 __hash__ function is removed when a class provides __eq__
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 33e4a2d..8f26777 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -477,6 +477,11 @@ class EntryProxy(SCons.Util.Proxy): __str__ = SCons.Util.Delegate('__str__') + # In PY3 if a class defines __eq__, then it must explicitly provide + # __hash__. Since SCons.Util.Proxy provides __eq__ we need the following + # see: https://docs.python.org/3.1/reference/datamodel.html#object.__hash__ + __hash__ = SCons.Util.Delegate('__hash__') + def __get_abspath(self): entry = self.get() return SCons.Subst.SpecialAttrWrapper(entry.get_abspath(), @@ -574,6 +579,7 @@ class EntryProxy(SCons.Util.Proxy): else: return attr_function(self) + class Base(SCons.Node.Node): """A generic class for file system entries. This class is for when we don't know yet whether the entry being looked up is a file |