diff --git a/setup.py b/setup.py index 80849f2..0653a99 100644 --- a/setup.py +++ b/setup.py @@ -31,4 +31,7 @@ keywords='weakref WeakMethod', tests_require=['unittest2'], test_suite='test_weakmethod', + extra_requires={ + 'test': ["tox"] + } ) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..de9bc3c --- /dev/null +++ b/tox.ini @@ -0,0 +1,8 @@ +[tox] +envlist = py26, py27, py32, py33 + +[testenv] +commands = + unit2 +deps = + unittest2 \ No newline at end of file diff --git a/weakrefmethod/__init__.py b/weakrefmethod/__init__.py index 7eacc2f..77e9d8b 100644 --- a/weakrefmethod/__init__.py +++ b/weakrefmethod/__init__.py @@ -1,2 +1,2 @@ -from _version import __version__ -from weakrefmethod import WeakMethod +from ._version import __version__ +from .weakrefmethod import WeakMethod diff --git a/weakrefmethod/weakrefmethod.py b/weakrefmethod/weakrefmethod.py index 3355129..90e5a01 100644 --- a/weakrefmethod/weakrefmethod.py +++ b/weakrefmethod/weakrefmethod.py @@ -46,10 +46,6 @@ def __eq__(self, other): 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__