dnf-json: remove mutable default argument value
Mutable values should not be used as default function arguments.
This commit is contained in:
parent
1b86423d67
commit
43a90ed473
1 changed files with 3 additions and 1 deletions
4
dnf-json
4
dnf-json
|
|
@ -41,12 +41,14 @@ class CacheState():
|
|||
Meaning that the folders having reach a certain timeout will be deleted.
|
||||
"""
|
||||
|
||||
def __init__(self, cache_dir, cache_timeout, folder_dict={}):
|
||||
def __init__(self, cache_dir, cache_timeout, folder_dict=None):
|
||||
"""
|
||||
cache_dir the place where the state is stored
|
||||
folder_dict a dict containing the existing list of cache folders
|
||||
cache_timeout a timedelta before a cache folder can be deleted
|
||||
"""
|
||||
if folder_dict is None:
|
||||
folder_dict = {}
|
||||
self.cache_dir = cache_dir
|
||||
self.folder_dict = folder_dict
|
||||
self.cache_timeout = cache_timeout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue