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: diff --git a/lang/python/examples/howto/export-minimised-key.py b/lang/python/examples/howto/export-minimised-key.py index a5a453ce..ffd75248 100755 --- a/lang/python/examples/howto/export-minimised-key.py +++ b/lang/python/examples/howto/export-minimised-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: diff --git a/lang/python/examples/howto/export-secret-key.py b/lang/python/examples/howto/export-secret-key.py index e7d4e3af..af1aa70a 100755 --- a/lang/python/examples/howto/export-secret-key.py +++ b/lang/python/examples/howto/export-secret-key.py @@ -65,9 +65,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: diff --git a/lang/python/examples/howto/export-secret-keys.py b/lang/python/examples/howto/export-secret-keys.py index f0fddc6d..f4e50085 100755 --- a/lang/python/examples/howto/export-secret-keys.py +++ b/lang/python/examples/howto/export-secret-keys.py @@ -74,9 +74,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: diff --git a/lang/python/examples/howto/send-key-to-keyserver.py b/lang/python/examples/howto/send-key-to-keyserver.py index 3541b198..261c8b65 100755 --- a/lang/python/examples/howto/send-key-to-keyserver.py +++ b/lang/python/examples/howto/send-key-to-keyserver.py @@ -60,9 +60,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: