From 7e083b57c98c8bdc701527824b9f4120b3eeaa41 Mon Sep 17 00:00:00 2001 From: Zach Sailer Date: Thu, 25 Apr 2024 12:38:19 -0700 Subject: [PATCH] Add a no-op for backwards compatibility --- jupyter_server/extension/manager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jupyter_server/extension/manager.py b/jupyter_server/extension/manager.py index f51be19ed7..488bdbd622 100644 --- a/jupyter_server/extension/manager.py +++ b/jupyter_server/extension/manager.py @@ -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