# HG changeset patch # User Pierre-Yves David # Date 2023-11-08 21:17:41 # Node ID 5c9c41273367968af9b04481de13e014430ed516 # Parent d8f65fc72e7b9c02be33514ccec1d23f16318afc 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. diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -14,7 +14,6 @@ from .. import ( error, pycompat, urllibcompat, - util, ) from . import ( @@ -680,8 +679,7 @@ def pathsuboption(option, attr, display= """ 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)