aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples/howto/groups.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lang/python/examples/howto/groups.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lang/python/examples/howto/groups.py b/lang/python/examples/howto/groups.py
index 154961b1..72135382 100644
--- a/lang/python/examples/howto/groups.py
+++ b/lang/python/examples/howto/groups.py
@@ -42,7 +42,10 @@ try:
except:
process = subprocess.Popen(gpgconfcmd.split(), stdout=subprocess.PIPE)
procom = process.communicate()
- lines = procom[0].decode().splitlines()
+ if sys.version_info[0] == 2:
+ lines = procom[0].splitlines()
+ else:
+ lines = procom[0].decode().splitlines()
for i in range(len(lines)):
if lines[i].startswith("group") is True: