diff options
author | Martin Packman <gzlist@googlemail.com> | 2017-06-01 01:08:02 +0100 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-06-09 13:46:15 -0700 |
commit | 8c9df8ba637e222a3e9da6d365d225f9cad81f18 (patch) | |
tree | 6d191c77b561f78fb06aae9f909a50b5c67fe2ef /paramiko/common.py | |
parent | 17231b9a7c56bf06f1a848fc52554541a09a2eba (diff) | |
download | paramiko-8c9df8ba637e222a3e9da6d365d225f9cad81f18.tar.gz |
Tweak comments as suggested in review
Thanks to bitprophet and ploxiln.
Diffstat (limited to 'paramiko/common.py')
-rw-r--r-- | paramiko/common.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/paramiko/common.py b/paramiko/common.py index 3b18858b..8ce735d7 100644 --- a/paramiko/common.py +++ b/paramiko/common.py @@ -163,15 +163,16 @@ else: def asbytes(s): + """Coerce to bytes if possible or return unchanged.""" if isinstance(s, bytes_types): return s if isinstance(s, text_type): - # GZ 2017-05-25: Accept text and encode as utf-8 for compatibilty only. + # Accept text and encode as utf-8 for compatibility only. return s.encode("utf-8") asbytes = getattr(s, "asbytes", None) if asbytes is not None: return asbytes() - # May be an object that implements the buffer api, let callers decide + # May be an object that implements the buffer api, let callers handle. return s |