Merge pull request #4 from bworrell/master
Adding Python 3 support and fixed Python 2.6 bug.
This commit is contained in:
3
setup.py
3
setup.py
@@ -31,4 +31,7 @@ setup(
|
||||
keywords='weakref WeakMethod',
|
||||
tests_require=['unittest2'],
|
||||
test_suite='test_weakmethod',
|
||||
extra_requires={
|
||||
'test': ["tox"]
|
||||
}
|
||||
)
|
||||
|
||||
8
tox.ini
Normal file
8
tox.ini
Normal file
@@ -0,0 +1,8 @@
|
||||
[tox]
|
||||
envlist = py26, py27, py32, py33
|
||||
|
||||
[testenv]
|
||||
commands =
|
||||
unit2
|
||||
deps =
|
||||
unittest2
|
||||
@@ -1,2 +1,2 @@
|
||||
from _version import __version__
|
||||
from weakrefmethod import WeakMethod
|
||||
from ._version import __version__
|
||||
from .weakrefmethod import WeakMethod
|
||||
|
||||
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user