From 63591e36f0b1c6849cac016a606f560729150ace Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 30 Sep 2023 09:24:58 -0500 Subject: [PATCH] fixup --- jupyter_client/client.py | 4 ++-- jupyter_client/kernelspec.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jupyter_client/client.py b/jupyter_client/client.py index 8b568363..a52cecc7 100644 --- a/jupyter_client/client.py +++ b/jupyter_client/client.py @@ -117,8 +117,8 @@ 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] + and self.context is not None # type:ignore[redundant-expr] + and not self.context.closed ): if self.channels_running: if self.log: diff --git a/jupyter_client/kernelspec.py b/jupyter_client/kernelspec.py index 38756590..3ba91367 100644 --- a/jupyter_client/kernelspec.py +++ b/jupyter_client/kernelspec.py @@ -242,8 +242,8 @@ def _get_kernel_spec_by_name(self, kernel_name, resource_dir): resource_dir=resource_dir, **get_kernel_dict() ) # type:ignore[operator] if not kspec: - kspec = self.kernel_spec_class.from_resource_dir( - resource_dir # type:ignore[attr-defined] + kspec = self.kernel_spec_class.from_resource_dir( # type:ignore[attr-defined] + resource_dir ) if not KPF.instance(parent=self.parent).is_provisioner_available(kspec):