# HG changeset patch # User Pierre-Yves David # Date 2023-11-08 21:20:58 # Node ID eda075d7b2ac12d76a065a41d4d07fb92fedfa04 # Parent 7b837fabc990c71ab4a08e39e79cf15c03638e12 cleanup: turn `wrapfunction` deprecation warning into an error We could simply drop the check, but lets raise explicit error instead of suffering strange error in case of misuse. diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -674,9 +674,8 @@ def wrapfunction(container, funcname, wr assert callable(wrapper) if not isinstance(funcname, str): - msg = b"pass wrapfunction target name as `str`, not `bytes`" - util.nouideprecwarn(msg, b"6.6", stacklevel=2) - funcname = pycompat.sysstr(funcname) + msg = b"wrapfunction target name should be `str`, not `bytes`" + raise TypeError(msg) origfn = getattr(container, funcname) assert callable(origfn)