Skip to content

Conda: protect against None when appending core requirements #8077

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

Merged
merged 1 commit into from
Apr 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,8 @@ def _append_core_requirements(self):

for item in dependencies:
if isinstance(item, dict) and 'pip' in item:
pip_requirements.extend(item.get('pip', []))
# NOTE: pip can be ``None``
pip_requirements.extend(item.get('pip') or [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth a comment here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stsewd the comment you added in the description of the PR is a good one. "pip can be None" says less than the description, where you explained the reason of pip being None which adds good context to the problem.

dependencies.remove(item)
break

Expand Down