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

Problem in _saferef.py #20

Closed
pwrdby opened this issue Aug 26, 2015 · 2 comments
Closed

Problem in _saferef.py #20

pwrdby opened this issue Aug 26, 2015 · 2 comments

Comments

@pwrdby
Copy link

pwrdby commented Aug 26, 2015

My code reported this error:
File "/home/lib/python3.4/site-packages/blinker/_saferef.py", line 197, in calculate_key
return (id(get_self(target)), id(get_func(target)))
AttributeError: 'function' object has no attribute 'self' .
When i print(dir(target)) i got this:
['annotations', 'call', 'class', 'closure', 'code', 'defaults', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'get', 'getattribute', 'globals', 'gt', 'hash', 'init', 'kwdefaults', 'le', 'lt', 'module', 'name', 'ne', 'new', 'qualname', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'accept', 'im_func', 'im_self', 'is_signal_handler']

There is no 'self', just 'im_self'. I tried to change the code on line 50 in file _saferef.py:
from if sys.version_info < (3,):
to if sys.version_info > (3,):

and my code works. Is it a mistake in my code or is it a bug ?
Thank you for your patience.

@jek
Copy link
Contributor

jek commented Aug 26, 2015

Can you paste a test case that produces that traceback? All the tests pass on 3.4, so perhaps something is missing in the tests or in the (increasingly creaky) saferef implementation.

@pwrdby
Copy link
Author

pwrdby commented Aug 27, 2015

I ran more tests and I found out, that bug is in lib mongoengine, which assumed blinker version 0.9.
Sorry for misunderstanding.

@pwrdby pwrdby closed this as completed Aug 27, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants