From ac4eb7478109027af4460a8fdf85ab7a2d5fe3c4 Mon Sep 17 00:00:00 2001 From: mver-al <114071453+mver-al@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:03:50 +0100 Subject: [PATCH] Allow setting password to None. --- asyncua/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asyncua/client/client.py b/asyncua/client/client.py index 758b0a10d..755b94329 100644 --- a/asyncua/client/client.py +++ b/asyncua/client/client.py @@ -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