From 9cf07c2cbca6f2ed94d8e89d9f459ef30d377575 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 29 Feb 2024 07:00:19 -0600 Subject: [PATCH 1/2] fix side effect import --- ipykernel/pickleutil.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ipykernel/pickleutil.py b/ipykernel/pickleutil.py index c6a2e448..f14938d2 100644 --- a/ipykernel/pickleutil.py +++ b/ipykernel/pickleutil.py @@ -10,6 +10,7 @@ from types import FunctionType # This registers a hook when it's imported +from ipyparallel.serialize import codeutil # noqa: F401 from traitlets.log import get_logger from traitlets.utils.importstring import import_item From f34c2cc9ed315f8e6c86b855872565f577ef17b1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 29 Feb 2024 07:24:36 -0600 Subject: [PATCH 2/2] add import guard --- ipykernel/pickleutil.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipykernel/pickleutil.py b/ipykernel/pickleutil.py index f14938d2..6f156594 100644 --- a/ipykernel/pickleutil.py +++ b/ipykernel/pickleutil.py @@ -10,7 +10,10 @@ from types import FunctionType # This registers a hook when it's imported -from ipyparallel.serialize import codeutil # noqa: F401 +try: + from ipyparallel.serialize import codeutil # noqa: F401 +except ImportError: + pass from traitlets.log import get_logger from traitlets.utils.importstring import import_item