changeset 51180:5c9c41273367

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 08 Nov 2023 22:17:41 +0100
parents d8f65fc72e7b
children 7b837fabc990
files mercurial/utils/urlutil.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)