Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gpg: set default in function to allow global patch
Patching globals to modify function behavior is an anti-pattern and should not be recommended to a user!! But it seems acceptable in tests (see #542). For this to work, the global must not be used before being modified, which, AFAIK, is not possible, if the global is defined and used (e.g. in a function signature) in the same scope. This commit changes the relevant function to access the default value in local scope, so that it global can be imported and modified before it. More invasive but probably more correct solutions would be: - move either GPG_TIMEOUT or is_available_gnupg to a different module, or - call relevant functions in tests with an explicit timeout arg Signed-off-by: Lukas Puehringer <[email protected]>
- Loading branch information