mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 05:01:14 -07:00
Bump websocket-client from 1.5.1 to 1.6.2 (#2122)
* Bump websocket-client from 1.5.1 to 1.6.2 Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.5.1 to 1.6.2. - [Release notes](https://github.com/websocket-client/websocket-client/releases) - [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog) - [Commits](https://github.com/websocket-client/websocket-client/compare/v1.5.1...v1.6.2) --- updated-dependencies: - dependency-name: websocket-client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update websocket-client==1.6.2 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
c93f470371
commit
eac78a3047
22 changed files with 295 additions and 260 deletions
|
@ -2,7 +2,7 @@
|
|||
_url.py
|
||||
websocket - WebSocket client library for Python
|
||||
|
||||
Copyright 2022 engn33r
|
||||
Copyright 2023 engn33r
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -21,10 +21,10 @@ __all__ = ["NoLock", "validate_utf8", "extract_err_message", "extract_error_code
|
|||
|
||||
class NoLock:
|
||||
|
||||
def __enter__(self):
|
||||
def __enter__(self) -> None:
|
||||
pass
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
def __exit__(self, exc_type, exc_value, traceback) -> None:
|
||||
pass
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ try:
|
|||
# strings.
|
||||
from wsaccel.utf8validator import Utf8Validator
|
||||
|
||||
def _validate_utf8(utfbytes):
|
||||
def _validate_utf8(utfbytes: bytes) -> bool:
|
||||
return Utf8Validator().validate(utfbytes)[0]
|
||||
|
||||
except ImportError:
|
||||
|
@ -63,7 +63,7 @@ except ImportError:
|
|||
12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
|
||||
12,36,12,12,12,12,12,12,12,12,12,12, ]
|
||||
|
||||
def _decode(state, codep, ch):
|
||||
def _decode(state: int, codep: int, ch: int) -> tuple:
|
||||
tp = _UTF8D[ch]
|
||||
|
||||
codep = (ch & 0x3f) | (codep << 6) if (
|
||||
|
@ -72,7 +72,7 @@ except ImportError:
|
|||
|
||||
return state, codep
|
||||
|
||||
def _validate_utf8(utfbytes):
|
||||
def _validate_utf8(utfbytes: str or bytes) -> bool:
|
||||
state = _UTF8_ACCEPT
|
||||
codep = 0
|
||||
for i in utfbytes:
|
||||
|
@ -83,7 +83,7 @@ except ImportError:
|
|||
return True
|
||||
|
||||
|
||||
def validate_utf8(utfbytes):
|
||||
def validate_utf8(utfbytes: str or bytes) -> bool:
|
||||
"""
|
||||
validate utf8 byte string.
|
||||
utfbytes: utf byte string to check.
|
||||
|
@ -92,13 +92,13 @@ def validate_utf8(utfbytes):
|
|||
return _validate_utf8(utfbytes)
|
||||
|
||||
|
||||
def extract_err_message(exception):
|
||||
def extract_err_message(exception: Exception) -> str or None:
|
||||
if exception.args:
|
||||
return exception.args[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def extract_error_code(exception):
|
||||
def extract_error_code(exception: Exception) -> int or None:
|
||||
if exception.args and len(exception.args) > 1:
|
||||
return exception.args[0] if isinstance(exception.args[0], int) else None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue