changeset 51181:7b837fabc990

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 08 Nov 2023 22:19:20 +0100
parents 5c9c41273367
children eda075d7b2ac
files mercurial/extensions.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Wed Nov 08 22:17:41 2023 +0100
+++ b/mercurial/extensions.py	Wed Nov 08 22:19:20 2023 +0100
@@ -625,9 +625,8 @@
     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