If python-dmidecode is not available, then you can't test hasattr or you will get a NameError. Simply return instead. Signed-off-by: John Kacur <jkacur@xxxxxxxxxx> --- rteval/sysinfo/dmi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rteval/sysinfo/dmi.py b/rteval/sysinfo/dmi.py index bd397360096a..80cf3c723b36 100644 --- a/rteval/sysinfo/dmi.py +++ b/rteval/sysinfo/dmi.py @@ -42,6 +42,9 @@ except ModuleNotFoundError: def ProcessWarnings(): """ Process Warnings from dmidecode """ + if not dmidecode_loaded: + return + if not hasattr(dmidecode, 'get_warnings'): return -- 2.31.1