Skip to content

Commit 2d6f52b

Browse files
Unused *args in KernelManager's __init__ (#986)
* Unused *args in KernelManager `__init__` I think that if it is unused, then it is likely a mistake from the caller that meant to pass a kwargs. This seem to have been ignored since 7.0. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b61accf commit 2d6f52b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jupyter_client/manager.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import sys
1010
import typing as t
1111
import uuid
12+
import warnings
1213
from asyncio.futures import Future
1314
from concurrent.futures import Future as CFuture
1415
from contextlib import contextmanager
@@ -107,6 +108,15 @@ class KernelManager(ConnectionFileMixin):
107108

108109
def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
109110
"""Initialize a kernel manager."""
111+
if args:
112+
warnings.warn(
113+
"Passing positional only arguments to "
114+
"`KernelManager.__init__` is deprecated since jupyter_client"
115+
" 8.6, and will become an error on future versions. Positional "
116+
" arguments have been ignored since jupyter_client 7.0",
117+
DeprecationWarning,
118+
stacklevel=2,
119+
)
110120
self._owns_kernel = kwargs.pop("owns_kernel", True)
111121
super().__init__(**kwargs)
112122
self._shutdown_status = _ShutdownStatus.Unset

0 commit comments

Comments
 (0)