Skip to content

Commit

Permalink
Allow setting password to None.
Browse files Browse the repository at this point in the history
  • Loading branch information
mver-al committed Jan 8, 2025
1 parent 2242486 commit ac4eb74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asyncua/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ def set_user(self, username: str) -> None:
"""
self._username = username

def set_password(self, pwd: str) -> None:
def set_password(self, pwd: str | None) -> None:
"""
Set user password for the connection.
initial password from the URL will be overwritten
"""
if not isinstance(pwd, str):
if pwd is not None and not isinstance(pwd, str):
raise TypeError(f"Password must be a string, got {pwd} of type {type(pwd)}")
self._password = pwd

Expand Down

0 comments on commit ac4eb74

Please sign in to comment.