cleanup: turn `pathsuboption` deprecation warning into an error
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 08 Nov 2023 22:17:41 +0100
changeset 51138 5c9c41273367
parent 51137 d8f65fc72e7b
child 51139 7b837fabc990
cleanup: turn `pathsuboption` 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/utils/urlutil.py
--- a/mercurial/utils/urlutil.py	Wed Nov 08 22:13:14 2023 +0100
+++ b/mercurial/utils/urlutil.py	Wed Nov 08 22:17:41 2023 +0100
@@ -14,7 +14,6 @@
     error,
     pycompat,
     urllibcompat,
-    util,
 )
 
 from . import (
@@ -680,8 +679,7 @@
     """
     if isinstance(attr, bytes):
         msg = b'pathsuboption take `str` as "attr" argument, not `bytes`'
-        util.nouideprecwarn(msg, b"6.6", stacklevel=2)
-        attr = attr.decode('ascii')
+        raise TypeError(msg)
 
     def register(func):
         _pathsuboptions[option] = (attr, func)