diff options
Diffstat (limited to 'lang/python/examples/howto/groups.py')
-rw-r--r-- | lang/python/examples/howto/groups.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lang/python/examples/howto/groups.py b/lang/python/examples/howto/groups.py index b8317b69..154961b1 100644 --- a/lang/python/examples/howto/groups.py +++ b/lang/python/examples/howto/groups.py @@ -37,7 +37,12 @@ if sys.platform == "win32": else: gpgconfcmd = "gpgconf --list-options gpg" -lines = subprocess.getoutput(gpgconfcmd).splitlines() +try: + lines = subprocess.getoutput(gpgconfcmd).splitlines() +except: + process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE) + procom = process.communicate() + lines = procom[0].decode().splitlines() for i in range(len(lines)): if lines[i].startswith("group") is True: |