PR#1807: util: rename "dict" arg
Merges #1807 https://pagure.io/koji/pull-request/1807 Fixes: #1812 util: rename "dict" arg https://pagure.io/koji/issue/1812
This commit is contained in:
commit
1d42e444c6
1 changed files with 5 additions and 5 deletions
10
koji/util.py
10
koji/util.py
|
|
@ -190,19 +190,19 @@ def multi_fnmatch(s, patterns):
|
|||
return False
|
||||
|
||||
|
||||
def dslice(dict, keys, strict=True):
|
||||
def dslice(dict_, keys, strict=True):
|
||||
"""Returns a new dictionary containing only the specified keys"""
|
||||
ret = {}
|
||||
for key in keys:
|
||||
if strict or key in dict:
|
||||
if strict or key in dict_:
|
||||
#for strict we skip the has_key check and let the dict generate the KeyError
|
||||
ret[key] = dict[key]
|
||||
ret[key] = dict_[key]
|
||||
return ret
|
||||
|
||||
|
||||
def dslice_ex(dict, keys, strict=True):
|
||||
def dslice_ex(dict_, keys, strict=True):
|
||||
"""Returns a new dictionary with only the specified keys removed"""
|
||||
ret = dict.copy()
|
||||
ret = dict_.copy()
|
||||
for key in keys:
|
||||
if strict or key in ret:
|
||||
del ret[key]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue