From 9399e9693f1091fbf8d22092f49be859aee7e245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Nordl=C3=B6w?= Date: Thu, 1 Aug 2024 09:40:35 +0200 Subject: [PATCH] Please ruff --- benchmark | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/benchmark b/benchmark index 93abd31..71ae73a 100755 --- a/benchmark +++ b/benchmark @@ -20,6 +20,8 @@ from timeit import default_timer as timer from process_timer import ProcessTimer +import importlib + DEFAULT_PROGRAM_NAME = 'main' SUPPORTED_OPERATIONS = ['Check', 'Compile', 'Build'] @@ -1941,9 +1943,10 @@ def main(): def install_missing_modules(): try: - import psutil - except ImportError: + importlib.import_module('psutil') + except ModuleNotFoundError: print("Installing missing modules...") + import pip pip.main(["install", "psutil"]) print("Missing modules installed successfully.")