diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2023-01-11 20:24:13 -0500 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2023-01-11 20:24:13 -0500 |
commit | ec8948158e26df0ec549e333cc2ea4bb22d56350 (patch) | |
tree | 605531478922a9b56d867e8044387711f32b68d2 /paramiko/util.py | |
parent | 19a00412bfecd43d4fa6a13459955ccb13f29e02 (diff) | |
download | paramiko-ec8948158e26df0ec549e333cc2ea4bb22d56350.tar.gz |
blacken
Diffstat (limited to 'paramiko/util.py')
-rw-r--r-- | paramiko/util.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/paramiko/util.py b/paramiko/util.py index 5e2f6392..5a21977e 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -29,7 +29,14 @@ import traceback import threading import logging -from paramiko.common import DEBUG, zero_byte, xffffffff, max_byte, byte_ord, byte_chr +from paramiko.common import ( + DEBUG, + zero_byte, + xffffffff, + max_byte, + byte_ord, + byte_chr, +) from paramiko.config import SSHConfig @@ -67,7 +74,7 @@ def deflate_long(n, add_sign_padding=True): for i in enumerate(s): if (n == 0) and (i[1] != 0): break - if (n == -1) and (i[1] != 0xff): + if (n == -1) and (i[1] != 0xFF): break else: # degenerate case, n was either 0 or -1 @@ -330,6 +337,7 @@ def b(s, encoding="utf8"): else: raise TypeError("Expected unicode or bytes, got {!r}".format(s)) + # TODO: clean this up / force callers to assume bytes OR unicode def u(s, encoding="utf8"): """cast bytes or unicode to unicode""" |