Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: too many arguments dropped when passing to base comm constructor #1051

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion ipykernel/comm/comm.py
Expand Up @@ -71,7 +71,8 @@ def _default_comm_id(self):
def __init__(self, *args, **kwargs):
# Comm takes positional arguments, LoggingConfigurable does not, so we explicitly forward arguments
traitlets.config.LoggingConfigurable.__init__(self, **kwargs)
for name in self.trait_names():
# drop arguments not in BaseComm
for name in ["kernel"]:
if name in kwargs:
kwargs.pop(name)
maartenbreddels marked this conversation as resolved.
Show resolved Hide resolved
BaseComm.__init__(self, *args, **kwargs)
Expand Down
3 changes: 2 additions & 1 deletion ipykernel/tests/test_comm.py
Expand Up @@ -6,7 +6,7 @@ def test_comm(kernel):
manager = CommManager(kernel=kernel)
kernel.comm_manager = manager

c = Comm(kernel=kernel)
c = Comm(kernel=kernel, target_name="bar")
msgs = []

def on_close(msg):
Expand All @@ -23,6 +23,7 @@ def on_message(msg):
c.handle_close({})
c.close()
assert len(msgs) == 2
assert c.target_name == "bar"


def test_comm_manager(kernel):
Expand Down