Default error to "", _client_first/_salted_password/_auth_message to b""

(sasl.scram)
This commit is contained in:
jesopo 2019-02-06 22:36:25 +00:00
parent 1bac2f67de
commit c77d8aaac8

View file

@ -36,11 +36,11 @@ class SCRAM(object):
self._password = password.encode("utf8")
self.state = SCRAMState.Uninitialised
self.error = None # typing.Optional[str]
self.error = ""
self._client_first = None # typing.Optional[bytes]
self._salted_password = None # typing.Optional[bytes]
self._auth_message = None # typing.Optional[bytes]
self._client_first = b""
self._salted_password = b""
self._auth_message = b""
def _get_pieces(self, data: bytes) -> typing.Dict[bytes, bytes]:
pieces = (piece.split(b"=", 1) for piece in data.split(b","))