Skip to content

fix: return the descriptor on class access for boolean config options - #1356

Closed
adityajai119 wants to merge 1 commit into
python-hyper:masterfrom
adityajai119:fix/config-boolean-descriptor-class-access
Closed

adityajai119 wants to merge 1 commit into
python-hyper:masterfrom
adityajai119:fix/config-boolean-descriptor-class-access

Conversation

@adityajai119

Copy link
Copy Markdown

Fixes a descriptor-protocol violation in \h2.config._BooleanConfigOption.

_get_\ called \getattr(instance, ...)\ unconditionally, so reading a boolean config option on the class (\H2Configuration.client_side) raised \AttributeError: 'NoneType' object has no attribute '_client_side'\ instead of returning the descriptor. The fix returns \self\ when \instance is None, matching standard Python descriptor behaviour.

Tests: 5 new focused parametrized cases in \ ests/test_config.py; full suite 1689 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant