Skip to content

Commit

Permalink
fix assertions for self._password?
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuyukai committed Dec 22, 2023
1 parent 4296f42 commit 4627ca5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pg_purepy/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ def get_needed_synchronisation(self) -> bytes:
code = FrontendMessageCode.PASSWORD

# type ignore is fine, ``_check_password`` verifies itt.
assert self._password
assert self._password is not None
packet_body += self._password.encode(encoding="ascii")
self.state = ProtocolState.CLEARTEXT_SENT

Expand All @@ -1208,7 +1208,7 @@ def get_needed_synchronisation(self) -> bytes:
assert salt, "state is MD5_STARTUP but salt is None?"
self._check_password()

assert self._password
assert self._password is not None

code = FrontendMessageCode.PASSWORD
hashed_password = md5(self._password.encode("ascii") + self.username.encode("ascii"))
Expand Down

0 comments on commit 4627ca5

Please sign in to comment.