From 9b63345b440f6f6b2149bb83ebccef1fb5187cb9 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Sat, 2 May 2020 09:49:28 +0200 Subject: [PATCH] [modules/nvidiagpu] Fix double "not found" check refactor error: it should be *either* "not found" in string *OR* string.startswith("something"), not both. fixes #617 --- modules/contrib/nvidiagpu.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/contrib/nvidiagpu.py b/modules/contrib/nvidiagpu.py index cd051cb..9d58d17 100644 --- a/modules/contrib/nvidiagpu.py +++ b/modules/contrib/nvidiagpu.py @@ -25,9 +25,7 @@ class Module(core.module.Module): return self.__utilization def hidden(self): - if "not found" in self._utilization.startswith("not found"): - return True - return False + return "not found" in self.__utilization def update(self): sp = util.cli.execute('nvidia-smi -q', ignore_errors=True)