Fix pylint error
This commit is contained in:
parent
2346e271ac
commit
5fc964e4ed
|
@ -86,20 +86,19 @@ class Unpacker():
|
|||
self.idx += str_end + 1
|
||||
if sanitize == NO_SANITIZE:
|
||||
return res.decode('utf-8', 'ignore')
|
||||
elif sanitize == SANITIZE:
|
||||
if sanitize == SANITIZE:
|
||||
return bytes( \
|
||||
[x if x > 32 or x in (9, 10, 13) else 32 for x in res]) \
|
||||
.decode('utf-8', 'ignore' \
|
||||
)
|
||||
elif sanitize == SANITIZE_CC:
|
||||
if sanitize == SANITIZE_CC:
|
||||
return bytes( \
|
||||
[x if x > 32 else 32 for x in res]) \
|
||||
.decode('utf-8', 'ignore' \
|
||||
)
|
||||
elif sanitize == SKIP_START_WHITESPACES:
|
||||
if sanitize == SKIP_START_WHITESPACES:
|
||||
return res.decode('utf-8').lstrip()
|
||||
else:
|
||||
raise ValueError(f"Error: invalid sanitize mode {sanitize}")
|
||||
raise ValueError(f"Error: invalid sanitize mode {sanitize}")
|
||||
|
||||
# TODO: optimize performance and benchmark in tests
|
||||
def pack_int(num: int) -> bytes:
|
||||
|
|
Loading…
Reference in a new issue