aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples/howto/export-key.py
diff options
context:
space:
mode:
authorBen McGinnes <[email protected]>2018-09-26 23:57:50 +0000
committerBen McGinnes <[email protected]>2018-09-26 23:57:50 +0000
commit7c9f49a4991c1ccd0cb582875207b373d4fccf50 (patch)
treefc9b4188360946d4d8d6ca54f92d0d238df7e437 /lang/python/examples/howto/export-key.py
parentdocs: a typographical two-step (diff)
downloadgpgme-7c9f49a4991c1ccd0cb582875207b373d4fccf50.tar.gz
gpgme-7c9f49a4991c1ccd0cb582875207b373d4fccf50.zip
examples: python bindings
* Fixed homedir specifying logic in several cases.
Diffstat (limited to 'lang/python/examples/howto/export-key.py')
-rwxr-xr-xlang/python/examples/howto/export-key.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lang/python/examples/howto/export-key.py b/lang/python/examples/howto/export-key.py
index c17f2471..ff3345a7 100755
--- a/lang/python/examples/howto/export-key.py
+++ b/lang/python/examples/howto/export-key.py
@@ -62,9 +62,9 @@ elif homedir.startswith("~"):
else:
homedir = os.path.realpath(homedir)
-if os.path.exists(homedir) is False:
+if homedir is not None and os.path.exists(homedir) is False:
homedir = None
-else:
+elif homedir is not None and os.path.exists(homedir) is True:
if os.path.isdir(homedir) is False:
homedir = None
else: