From 4e8a92ed14ea3da3d92f07d5f62fd325a2adebde Mon Sep 17 00:00:00 2001 From: Ben McGinnes Date: Sun, 16 Sep 2018 03:34:36 +1000 Subject: Python bindings: examples * lang/python/examples/howto/export-secret-keys.py and groups.py: Updated the backwards compatibility adjustments to account for unicode differences between python 2 and 3. --- lang/python/examples/howto/groups.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lang/python/examples/howto/groups.py') 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: -- cgit v1.2.3