-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
cut hard dependency on requests #19930
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,8 @@ def _case_insensitive_dict(*args, **kwargs): | |
# multidict is installed by aiohttp | ||
from multidict import CIMultiDict | ||
|
||
if len(kwargs) == 0 and len(args) == 1 and (not args[0]): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to handle case_insensitive_dict(None). requests.structures.CaseInsensitiveDict returns empty dict while multidict.CIMultiDict raise error. Here we want to return dict(). |
||
return CIMultiDict() | ||
return CIMultiDict(*args, **kwargs) | ||
except ImportError: | ||
raise ValueError( | ||
|
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.
Could we add comments to all the the try/except blocks here? The logic is a little hard to follow :)