Skip to content

Commit

Permalink
Set stacklevel on warning to point to the right place. (#572)
Browse files Browse the repository at this point in the history
Without stacklevel=2, the warnings are a bit useless as we don't know
where the deprecated function is used.
  • Loading branch information
Carreau authored Aug 17, 2021
1 parent f914126 commit 1444737
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jupyter_server/transutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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


Expand Down

0 comments on commit 1444737

Please sign in to comment.