Merge pull request #4 from bworrell/master

Adding Python 3 support and fixed Python 2.6 bug.
This commit is contained in:
Tommy Wang
2016-01-26 20:27:37 -06:00
4 changed files with 14 additions and 7 deletions

View File

@@ -31,4 +31,7 @@ setup(
keywords='weakref WeakMethod',
tests_require=['unittest2'],
test_suite='test_weakmethod',
extra_requires={
'test': ["tox"]
}
)

8
tox.ini Normal file
View File

@@ -0,0 +1,8 @@
[tox]
envlist = py26, py27, py32, py33
[testenv]
commands =
unit2
deps =
unittest2

View File

@@ -1,2 +1,2 @@
from _version import __version__
from weakrefmethod import WeakMethod
from ._version import __version__
from .weakrefmethod import WeakMethod

View File

@@ -46,10 +46,6 @@ class WeakMethod(weakref.ref):
return False
def __ne__(self, other):
if isinstance(other, WeakMethod):
if not self._alive or not other._alive:
return self is not other
return weakref.ref.__ne__(self, other) or self._func_ref != other._func_ref
return True
return not self.__eq__(other)
__hash__ = weakref.ref.__hash__