Mercurial > hg
changeset 50927:7a8ea1397816
check-code: drop the `safehasattr` rule
Since we no longer supports Python 2 we no longer needs to use a custom function
to compensate the short comings of the global `hasattr` function in it.
We cannot use the Python 3 `hasattr` function instead.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 08 Dec 2022 15:33:19 +0100 |
parents | bc9c9ed0659d |
children | d718eddf01d9 |
files | contrib/check-code.py |
diffstat | 1 files changed, 0 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Fri Sep 01 16:36:13 2023 +0200 +++ b/contrib/check-code.py Thu Dec 08 15:33:19 2022 +0100 @@ -383,12 +383,6 @@ "use True/False for constant Boolean expression", ), (r'^\s*if False(:| +and)', 'Remove code instead of using `if False`'), - ( - r'(?:(?<!def)\s+|\()hasattr\(', - 'hasattr(foo, bar) is broken on py2, use util.safehasattr(foo, bar) ' - 'instead', - r'#.*hasattr-py3-only', - ), (r'opener\([^)]*\).read\(', "use opener.read() instead"), (r'opener\([^)]*\).write\(', "use opener.write() instead"), (r'(?i)descend[e]nt', "the proper spelling is descendAnt"),