From 60fc2947f0b208299c8dd7125431ba70d3b57e04 Mon Sep 17 00:00:00 2001 From: jason kirtland Date: Wed, 3 Jul 2013 09:49:09 +0200 Subject: Support Python >= 2.7 transition from im_func to __func__ (fixes #6) --- blinker/_utilities.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blinker/_utilities.py b/blinker/_utilities.py index a0c26bb..056270d 100644 --- a/blinker/_utilities.py +++ b/blinker/_utilities.py @@ -111,7 +111,9 @@ except NameError: def hashable_identity(obj): - if hasattr(obj, 'im_func'): + if hasattr(obj, '__func__'): + return (id(obj.__func__), id(obj.__self__)) + elif hasattr(obj, 'im_func'): return (id(obj.im_func), id(obj.im_self)) elif isinstance(obj, text): return obj -- cgit v1.2.1