Skip to content

Commit

Permalink
REF: Use walrus operator to reduce conditions
Browse files Browse the repository at this point in the history
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
  • Loading branch information
carterbox and kenodegard authored Jun 5, 2024
1 parent 5d8efe9 commit c92f1a1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2735,12 +2735,8 @@ def build(
# This is wrong, files has not been expanded at this time and could contain
# wildcards. Also well, I just do not understand this, because when this
# does contain wildcards, the files in to_remove will slip back in.
if (
"files" in output_d
and output_d["files"] is not None
and not isinstance(output_d["files"], dict)
):
output_d["files"] = set(output_d["files"]) - to_remove
if (files := output_d.get("files")) and not isinstance(files, dict):
output_d["files"] = set(files) - to_remove

# copies the backed-up new prefix files into the newly created host env
for f in new_prefix_files:
Expand Down

0 comments on commit c92f1a1

Please sign in to comment.