summaryrefslogtreecommitdiff
path: root/paramiko/pkey.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2022-03-14 19:21:01 -0400
committerJeff Forcier <jeff@bitprophet.org>2022-03-14 19:23:40 -0400
commit76b781754bfefe21706762442c422bac523701e4 (patch)
tree18c662d43922a463e173f97b531d44d7edac8ffd /paramiko/pkey.py
parentabbf52a8c390b38ab4b8d83fc23bbaab3a31abb4 (diff)
downloadparamiko-76b781754bfefe21706762442c422bac523701e4.tar.gz
Use args, not kwargs, to retain py2 compat for now
Diffstat (limited to 'paramiko/pkey.py')
-rw-r--r--paramiko/pkey.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index 67945261..797e7723 100644
--- a/paramiko/pkey.py
+++ b/paramiko/pkey.py
@@ -565,9 +565,10 @@ class PKey(object):
# existing files, so using all 3 in both cases is fine. Ditto the use
# of the 'mode' argument; it should be safe to give even for existing
# files (though it will not act like a chmod in that case).
- kwargs = dict(flags=os.O_WRONLY | os.O_TRUNC | os.O_CREAT, mode=o600)
+ # TODO 3.0: turn into kwargs again
+ args = [os.O_WRONLY | os.O_TRUNC | os.O_CREAT, o600]
# NOTE: yea, you still gotta inform the FLO that it is in "write" mode
- with os.fdopen(os.open(filename, **kwargs), mode="w") as f:
+ with os.fdopen(os.open(filename, *args), "w") as f:
# TODO 3.0: remove the now redundant chmod
os.chmod(filename, o600)
self._write_private_key(f, key, format, password=password)