aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/examples/howto/export-key.py
diff options
context:
space:
mode:
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: