# HG changeset patch # User Pierre-Yves David # Date 2023-02-02 16:27:33 # Node ID eb49f8fb11d83fb6bf1b1ac639ebb1a392ce7afb # Parent 6be6406a298830bfc690e36f22da8b74a8c7afe8 safehasattr: pass attribute name as string instead of bytes This is a step toward replacing `util.safehasattr` usage with plain `hasattr`. The builtin function behave poorly in Python2 but this was fixed in Python3. These change are done one by one as they tend to have a small odd to trigger puzzling breackage. diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -214,7 +214,7 @@ class _httprequesthandler(httpservermod. env['wsgi.multithread'] = isinstance( self.server, socketserver.ThreadingMixIn ) - if util.safehasattr(socketserver, b'ForkingMixIn'): + if util.safehasattr(socketserver, 'ForkingMixIn'): env['wsgi.multiprocess'] = isinstance( self.server, socketserver.ForkingMixIn )