Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit d6aef1b

Browse files
authored
Return None instead of empty str (#89)
1 parent 6edb1fa commit d6aef1b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pancloud/adapters/tinydb_adapter.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ def fetch_credential(self, credential=None, profile=None):
3030
str, None: Fetched credential or ``None``.
3131
3232
"""
33-
q = self.db.search(self.query.profile == profile)
34-
try:
35-
return q[0].get(credential, '')
36-
except (AttributeError, ValueError, IndexError):
37-
return
33+
q = self.db.get(self.query.profile == profile)
34+
if q is not None:
35+
return q.get(credential)
3836

3937
def init_store(self):
4038
path = os.path.join(

0 commit comments

Comments
 (0)