diff options
Diffstat (limited to '')
-rwxr-xr-x | lang/python/examples/howto/export-secret-keys.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lang/python/examples/howto/export-secret-keys.py b/lang/python/examples/howto/export-secret-keys.py index f0a791ef..7203ded9 100755 --- a/lang/python/examples/howto/export-secret-keys.py +++ b/lang/python/examples/howto/export-secret-keys.py @@ -84,7 +84,13 @@ else: if os.path.exists(os.environ["GNUPGHOME"]) is True: hd = os.environ["GNUPGHOME"] else: - hd = subprocess.getoutput(gpgconfcmd) + try: + hd = subprocess.getoutput(gpgconfcmd) + except: + process = subprocess.Popen(gpgconfcmd.split(), + stdout=subprocess.PIPE) + procom = process.communicate() + hd = procom[0].decode().strip() gpgfile = "{0}/{1}.gpg".format(hd, keyfile) ascfile = "{0}/{1}.asc".format(hd, keyfile) |