Skip to content

Commit fbe02ae

Browse files
authored
Merge pull request #411 from fcollonval/patch-3
Emit deprecation warning on old name
2 parents b5cebd6 + 04f7bb1 commit fbe02ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jupyter_server/extension/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import importlib
2+
import warnings
23

34

45
class ExtensionLoadingError(Exception):
@@ -28,6 +29,11 @@ def get_loader(obj, logger=None):
2829
func = getattr(obj, '_load_jupyter_server_extension')
2930
except AttributeError:
3031
func = getattr(obj, 'load_jupyter_server_extension')
32+
warnings.warn("A `_load_jupyter_server_extension` function was not "
33+
"found in {name!s}. Instead, a `load_jupyter_server_extension` "
34+
"function was found and will be used for now. This function "
35+
"name will be deprecated in future releases "
36+
"of Jupyter Server.".format(name=obj), DeprecationWarning)
3137
except Exception:
3238
raise ExtensionLoadingError("_load_jupyter_server_extension function was not found.")
3339
return func

0 commit comments

Comments
 (0)