From 00a7258739636cd0b41657a16722ba84f6be523f Mon Sep 17 00:00:00 2001 From: Lei Yang Date: Mon, 3 Jul 2023 18:54:40 +0800 Subject: [PATCH] utils.network.hosts: Make subclass of Host instantiable A regression bug was introduced by 94fb7a8,which results Host's subclass LocalHost can not be instantiated. Existing instantiation methods the same as "localhost = LocalHost()" will no longer fail after changed. Signed-off-by: Lei Yang --- avocado/utils/network/hosts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avocado/utils/network/hosts.py b/avocado/utils/network/hosts.py index 4a07c5082e..7d61ad6401 100644 --- a/avocado/utils/network/hosts.py +++ b/avocado/utils/network/hosts.py @@ -48,7 +48,7 @@ class Host: """ def __init__(self, host): - if isinstance(self, Host): + if type(self) == Host: # pylint: disable=C0123 raise TypeError("Host class should not be instantiated") self.host = host