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.
--- 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"),