Mercurial > public > mercurial-scm > hg-stable
diff mercurial/registrar.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 | 642e31cb55f0 |
children | 752c5a5b73c6 |
line wrap: on
line diff
--- a/mercurial/registrar.py Thu Dec 08 15:33:19 2022 +0100 +++ b/mercurial/registrar.py Thu Aug 31 23:56:15 2023 +0200 @@ -10,7 +10,6 @@ configitems, error, pycompat, - util, ) # unlike the other registered items, config options are neither functions or @@ -64,7 +63,7 @@ msg = b'duplicate registration for name: "%s"' % name raise error.ProgrammingError(msg) - if func.__doc__ and not util.safehasattr(func, '_origdoc'): + if func.__doc__ and not hasattr(func, '_origdoc'): func._origdoc = func.__doc__.strip() doc = pycompat.sysbytes(func._origdoc) func.__doc__ = pycompat.sysstr(self._formatdoc(decl, doc))