-
Notifications
You must be signed in to change notification settings - Fork 445
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
actually hook up the unknown capability fallback #191
Conversation
(You can merge it like this but I will try to add a test for this situation) |
Test added! It is a bit hacky though. |
Ok, I understand your patch, I have no issue to merge it, however the test code for capability 66 makes no sense to me. Can you please enlighten me 😄 |
Got it ! Damn, I am slow tonight ! Could you:
|
Today is not my day ... if the function is not a classmethod, it should be made a classmethod which take the cls as first parameter. so the patch should only be to change @classmethod to @staticmethod (obviously the call must be changed as you did). |
I don't follow - |
changelog & option rename done. I should probably squash all of this but I'll wait until we are happy with the total result :) |
@@ -52,10 +52,10 @@ def hex (data): | |||
return '0x' + ''.join('%02x' % ord(_) for _ in data) | |||
|
|||
@classmethod | |||
def fallback_capability (cls): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really should just change the @classmethod to @staticmethod
Yes, it you could squash all the commit in one, once the @staticmethod change is perform, I will pull. |
/me bad. reading the patch and not the patched file ... |
Do not drop session when receiving an unknown capability
Without this patch,
_fallback_capability
is set only on the UnknownCapability class, not on the Capability class.To clarify, the very similar looking
register_capability
actually works because all subclasses share the dict that is attached toregistered_capability
, and no assignment to it happens, just operations on it. However, fallback happens via assignment, and hence we need this patch.