diff mercurial/help.py @ 50951:d718eddf01d9

safehasattr: drop usage in favor of hasattr The two functions should now be equivalent at least in their usage in core.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 31 Aug 2023 23:56:15 +0200
parents 822320591c46
children 18c8c18993f0
line wrap: on
line diff
--- a/mercurial/help.py	Thu Dec 08 15:33:19 2022 +0100
+++ b/mercurial/help.py	Thu Aug 31 23:56:15 2023 +0200
@@ -43,7 +43,6 @@
     templatefuncs,
     templatekw,
     ui as uimod,
-    util,
 )
 from .hgweb import webcommands
 from .utils import (
@@ -810,7 +809,7 @@
         doc = gettext(pycompat.getdoc(entry[0]))
         if not doc:
             doc = _(b"(no help text available)")
-        if util.safehasattr(entry[0], 'definition'):  # aliased command
+        if hasattr(entry[0], 'definition'):  # aliased command
             source = entry[0].source
             if entry[0].definition.startswith(b'!'):  # shell alias
                 doc = _(b'shell alias for: %s\n\n%s\n\ndefined by: %s\n') % (