From b3f0425ab62e8e89fd57fd767ad5d7a4a2895dca Mon Sep 17 00:00:00 2001 From: David Manthey Date: Mon, 4 Nov 2024 08:24:14 -0500 Subject: [PATCH] Modify a function to keep the type checker happy psutil can return none for the number of logical cpus --- large_image/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/large_image/config.py b/large_image/config.py index 199788857..c866f21d8 100644 --- a/large_image/config.py +++ b/large_image/config.py @@ -160,7 +160,7 @@ def cpu_count(logical: bool = True) -> int: try: import psutil - count = min(count, psutil.cpu_count(logical)) + count = min(count, psutil.cpu_count(logical) or count) except ImportError: pass return max(1, count)