summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2021-10-15 19:30:20 -0400
committerJeff Forcier <jeff@bitprophet.org>2021-10-15 19:30:20 -0400
commita73bf04c4c1105ec731cbd92b7dec350b3d1bdb6 (patch)
tree837d66a8fbdc9173032dc475a2cdfcbbf93759cd
parent45cfb6dd7f463b26d1c13828690c809ba6a189c2 (diff)
downloadparamiko-2.5.tar.gz
Enhance language around SSHClient.close()2.5
-rw-r--r--paramiko/client.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/paramiko/client.py b/paramiko/client.py
index 6bf479d4..6d1636be 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -441,11 +441,13 @@ class SSHClient(ClosingContextManager):
"""
Close this SSHClient and its underlying `.Transport`.
+ This should be called anytime you are done using the client object.
+
.. warning::
- Failure to do this may, in some situations, cause your Python
- interpreter to hang at shutdown (often due to race conditions).
- It's good practice to `close` your client objects anytime you're
- done using them, instead of relying on garbage collection.
+ Paramiko registers garbage collection hooks that will try to
+ automatically close connections for you, but this is not presently
+ reliable. Failure to explicitly close your client after use may
+ lead to end-of-process hangs!
"""
if self._transport is None:
return