Skip to content

Commit

Permalink
python3.6 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
zagy committed Dec 8, 2023
1 parent bace69c commit 67aa882
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/batou_ext/nix.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,12 @@ def seq_to_nix(seq):

def mapping_to_nix(obj):
# XXX: only str keys for now
converted = {
k: conv for k, v in obj.items() if (conv := value_to_nix(v)) is not None
}

converted = {}
for k, v in obj.items():
conv = value_to_nix(v)
if conv is not None:
converted[k] = conv
return nix_dict_to_nix(converted)


Expand Down

0 comments on commit 67aa882

Please sign in to comment.