Skip to content

Commit

Permalink
Add a no-op for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer committed Apr 25, 2024
1 parent 166c61d commit 7e083b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jupyter_server/extension/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,20 @@ def _get_loader(self):
return loader

def _get_starter(self):
"""Get a linker."""
"""Get a starter function."""
if self.app:
linker = self.app._start_jupyter_server_extension
else:

async def _noop_start(serverapp):
return

linker = getattr(
self.module,
# Search for a _start_jupyter_extension
"_start_jupyter_server_extension",
# Otherwise return a dummy function.
lambda serverapp: None,
# Otherwise return a no-op function.
_noop_start,
)
return linker

Expand Down

0 comments on commit 7e083b5

Please sign in to comment.