From 8f83ec91951db2f08fdc19d212d3d4767a444db7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 30 Sep 2023 09:24:24 -0500 Subject: [PATCH] fixup --- jupyter_client/client.py | 6 ++++-- jupyter_client/kernelspec.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jupyter_client/client.py b/jupyter_client/client.py index e11fe857..8b568363 100644 --- a/jupyter_client/client.py +++ b/jupyter_client/client.py @@ -116,8 +116,10 @@ def _context_default(self) -> zmq.Context: def __del__(self): """Handle garbage collection. Destroy context if applicable.""" if ( - self._created_context and self.context is not None and not self.context.closed - ): # type:ignore[redundant-expr] + self._created_context + and self.context is not None + and not self.context.closed # type:ignore[redundant-expr] + ): if self.channels_running: if self.log: self.log.warning("Could not destroy zmq context for %s", self) diff --git a/jupyter_client/kernelspec.py b/jupyter_client/kernelspec.py index f7d9ce49..38756590 100644 --- a/jupyter_client/kernelspec.py +++ b/jupyter_client/kernelspec.py @@ -243,8 +243,8 @@ def _get_kernel_spec_by_name(self, kernel_name, resource_dir): ) # type:ignore[operator] if not kspec: kspec = self.kernel_spec_class.from_resource_dir( - resource_dir - ) # type:ignore[attr-defined] + resource_dir # type:ignore[attr-defined] + ) if not KPF.instance(parent=self.parent).is_provisioner_available(kspec): raise NoSuchKernel(kernel_name)