Skip to content

Commit

Permalink
Fix retrieving a password in case the a function returns another call…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
dmach committed Oct 13, 2023
1 parent 225fea0 commit c96bd58
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ def data(self):
# we use the password only from time to time to make a session cookie
# and there's no need to keep the password in program memory longer than necessary
result = self._data()

# the function can also return a function, let's evaluate them recursively
while callable(result):
result = result()

if result is None:
raise oscerr.OscIOError(None, "Unable to retrieve password")
return result
Expand Down

0 comments on commit c96bd58

Please sign in to comment.