# HG changeset patch # User Pierre-Yves David # Date 2023-08-30 11:28:09 # Node ID b2b8c25f94629f65db835b429fb04f1544d58ec4 # Parent a834ec41f17cb01d6e90887cf6e8adafcba2746e hgwebmod: use sysstr to check for attribute presence We do not need bytes here. diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -403,7 +403,7 @@ class hgweb: cmd = cmd[style + 1 :] # avoid accepting e.g. style parameter as command - if util.safehasattr(webcommands, cmd): + if util.safehasattr(webcommands, pycompat.sysstr(cmd)): req.qsparams[b'cmd'] = cmd if cmd == b'static': @@ -474,7 +474,7 @@ class hgweb: # override easily enough. res.status = b'200 Script output follows' res.headers[b'Content-Type'] = ctype - return getattr(webcommands, cmd)(rctx) + return getattr(webcommands, pycompat.sysstr(cmd))(rctx) except (error.LookupError, error.RepoLookupError) as err: msg = pycompat.bytestr(err)