diff options
Diffstat (limited to 'buildscripts/ciconfig/tags.py')
-rw-r--r-- | buildscripts/ciconfig/tags.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/buildscripts/ciconfig/tags.py b/buildscripts/ciconfig/tags.py index 7e9688714f5..1627c117a98 100644 --- a/buildscripts/ciconfig/tags.py +++ b/buildscripts/ciconfig/tags.py @@ -119,21 +119,23 @@ class TagsConfig(object): def getdefault(doc, key, default): - """Return the value in 'doc' with key 'key' if it is present and not None, returns - the specified default value otherwise.""" + """Return the value in 'doc' with key 'key' if present and not None. + + Return the specified default value otherwise. + """ value = doc.get(key) if value is not None: return value - else: - return default + return default def setdefault(doc, key, default): - """Return the value in 'doc' with key 'key' if it is present and not None, sets the value - to default and return it otherwise.""" + """Return the value in 'doc' with key 'key' if present and not None. + + Otherwise set the value to default and return it. + """ value = doc.setdefault(key, default) if value is not None: return value - else: - doc[key] = default - return default + doc[key] = default + return default |