Skip to content

Commit

Permalink
Catch timeouts when checking for GPG availability.
Browse files Browse the repository at this point in the history
Fixes #428. Okay to do this because we will fail tests if GPG is unexpectedly
unavailable (#434).

Signed-off-by: Zachary Newman <zjn@chainguard.dev>
  • Loading branch information
znewman01 committed Oct 13, 2022
1 parent c879125 commit a5c0087
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion securesystemslib/gpg/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import functools
import logging
import os
import subprocess

from securesystemslib import process

Expand All @@ -30,7 +31,7 @@ def is_available_gnupg(gnupg: str) -> bool:
try:
process.run(gpg_version_cmd, stdout=process.PIPE, stderr=process.PIPE)
return True
except OSError:
except (OSError, subprocess.TimeoutExpired):
return False


Expand Down

0 comments on commit a5c0087

Please sign in to comment.