# HG changeset patch # User Pierre-Yves David # Date 2023-11-08 21:19:20 # Node ID 7b837fabc990c71ab4a08e39e79cf15c03638e12 # Parent 5c9c41273367968af9b04481de13e014430ed516 cleanup: turn `wrappedfunction` 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 @@ -625,9 +625,8 @@ class wrappedfunction: def __init__(self, container, funcname, wrapper): assert callable(wrapper) if not isinstance(funcname, str): - msg = b"pass wrappedfunction target name as `str`, not `bytes`" - util.nouideprecwarn(msg, b"6.6", stacklevel=2) - funcname = pycompat.sysstr(funcname) + msg = b"wrappedfunction target name should be `str`, not `bytes`" + raise TypeError(msg) self._container = container self._funcname = funcname self._wrapper = wrapper