blinker
blinker copied to clipboard
Slightly safer version-based checking for bound method
Utilities file was discriminating between different attributes for bound method with hasattrfunction but Saferef file was doing it with version-based discrimination.
It can cause problems if hasattrand getting the attribute returned not-Noneobject - e.g. when you are inheriting from Eventsclass (which python-eve does) but you are actually using Python 3+. In that case, utilitieswill find im_selfattribute (Events create all the attributes non-starting with __on-the-fly) but safereffile looks at the version number and tries to get __self__attribute. Which may not be (in python-eve case it is not) defined.
This PR unifies the approach to version-based
:+1: I just ran into this issue with Eve as well. Tested the PR out and everything seems to be working just fine.
I had this problem in Eve as well. I am glad that it helped you :-)
+1
How does it look like with this PR? We just ran into the same problem with Eve. 😢
This is no longer required.