# HG changeset patch # User Pierre-Yves David # Date 1693439688 -7200 # Node ID 0e6cea0c3113476512b69ca360b53a3e42d49ad2 # Parent 538c5a48e8f43c360cf37ce79041bf4046a313c4 extension: check the command attributes using `sysstr` Since we are checking attributes, lets use the native representation instead of bytes. diff -r 538c5a48e8f4 -r 0e6cea0c3113 mercurial/extensions.py --- a/mercurial/extensions.py Thu Aug 31 01:47:07 2023 +0200 +++ b/mercurial/extensions.py Thu Aug 31 01:54:48 2023 +0200 @@ -165,7 +165,7 @@ # attributes set by registrar.command -_cmdfuncattrs = (b'norepo', b'optionalrepo', b'inferrepo') +_cmdfuncattrs = ('norepo', 'optionalrepo', 'inferrepo') def _validatecmdtable(ui, cmdtable): @@ -175,10 +175,10 @@ missing = [a for a in _cmdfuncattrs if not util.safehasattr(f, a)] if not missing: continue - raise error.ProgrammingError( - b'missing attributes: %s' % b', '.join(missing), - hint=b"use @command decorator to register '%s'" % c, - ) + msg = b'missing attributes: %s' + msg %= b', '.join([stringutil.forcebytestr(m) for m in missing]) + hint = b"use @command decorator to register '%s'" % c + raise error.ProgrammingError(msg, hint=hint) def _validatetables(ui, mod):