cleanup: turn `wrapfunction` deprecation warning into an error
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 08 Nov 2023 22:20:58 +0100
changeset 51140 eda075d7b2ac
parent 51139 7b837fabc990
child 51141 c845479fc64d
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.
mercurial/extensions.py
--- a/mercurial/extensions.py	Wed Nov 08 22:19:20 2023 +0100
+++ b/mercurial/extensions.py	Wed Nov 08 22:20:58 2023 +0100
@@ -674,9 +674,8 @@
     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)