Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Python 3 support and fixed Python 2.6 bug. #4

Merged
merged 3 commits into from
Jan 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@
keywords='weakref WeakMethod',
tests_require=['unittest2'],
test_suite='test_weakmethod',
extra_requires={
'test': ["tox"]
}
)
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[tox]
envlist = py26, py27, py32, py33

[testenv]
commands =
unit2
deps =
unittest2
4 changes: 2 additions & 2 deletions weakrefmethod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from _version import __version__
from weakrefmethod import WeakMethod
from ._version import __version__
from .weakrefmethod import WeakMethod
6 changes: 1 addition & 5 deletions weakrefmethod/weakrefmethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__