From fae2f205a72b100c7c31e47bdfe807c583dba132 Mon Sep 17 00:00:00 2001 From: Jah-yee <166608075+Jah-yee@users.noreply.github.com> Date: Sat, 3 Oct 2026 19:58:09 +0800 Subject: [PATCH] fix: guard against invalid handle in close() (fixes #214) --- picoscope/picobase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picoscope/picobase.py b/picoscope/picobase.py index e02d788..00299fb 100644 --- a/picoscope/picobase.py +++ b/picoscope/picobase.py @@ -1127,7 +1127,7 @@ def close(self): You should call this yourself because the Python garbage collector might take some time. """ - if self.handle is not None: + if self.handle: self._lowLevelCloseUnit() self.handle = None