Skip to content

Commit 1444737

Browse files
authored
Set stacklevel on warning to point to the right place. (#572)
Without stacklevel=2, the warnings are a bit useless as we don't know where the deprecated function is used.
1 parent f914126 commit 1444737

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jupyter_server/transutils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def _trans_gettext_deprecation_helper(*args, **kwargs):
1212
warn_msg = "The alias `_()` will be deprecated. Use `_i18n()` instead."
13-
warnings.warn(warn_msg, FutureWarning)
13+
warnings.warn(warn_msg, FutureWarning, stacklevel=2)
1414
return trans.gettext(*args, **kwargs)
1515

1616

0 commit comments

Comments
 (0)