]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
more lgtm lint
authorBob Halley <halley@dnspython.org>
Mon, 21 Feb 2022 22:31:39 +0000 (14:31 -0800)
committerBob Halley <halley@dnspython.org>
Mon, 21 Feb 2022 22:31:39 +0000 (14:31 -0800)
dns/asyncbackend.py
dns/rdataset.py
dns/version.py

index aef14b556cb58fdde1dcc5297e02afd661f81f60..ad79a572b2827a9ef0c69f75dbad1af503302261 100644 (file)
@@ -4,8 +4,7 @@ import dns.exception
 
 # pylint: disable=unused-import
 
-from dns._asyncbackend import Socket, DatagramSocket, \
-    StreamSocket, Backend  # noqa: F401  lgtm[py/unused-import]
+from dns._asyncbackend import Socket, DatagramSocket, StreamSocket, Backend  # noqa: F401  lgtm[py/unused-import]
 
 # pylint: enable=unused-import
 
index 8da7f2b9b4b97d5efd3116eadfb0aea9b3857182..e6e954804f3dda27c61b26c7c350d84c1583a985 100644 (file)
@@ -356,16 +356,20 @@ class ImmutableRdataset(Rdataset):  # lgtm[py/missing-equals]
     def __delitem__(self, i):
         raise TypeError('immutable')
 
-    def __ior__(self, other):
+    # lgtm complains about these not raising ArithmeticError, but there is
+    # precedent for overrides of these methods in other classes to raise
+    # TypeError, and it seems like the better exception.
+
+    def __ior__(self, other):  # lgtm[py/unexpected-raise-in-special-method]
         raise TypeError('immutable')
 
-    def __iand__(self, other):
+    def __iand__(self, other):  # lgtm[py/unexpected-raise-in-special-method]
         raise TypeError('immutable')
 
-    def __iadd__(self, other):
+    def __iadd__(self, other):  # lgtm[py/unexpected-raise-in-special-method]
         raise TypeError('immutable')
 
-    def __isub__(self, other):
+    def __isub__(self, other):  # lgtm[py/unexpected-raise-in-special-method]
         raise TypeError('immutable')
 
     def clear(self):
index 1f54521d72fc027066085d443e8cfa10249fd847..1a503ad7c22a604391837f1aadd85106757531cf 100644 (file)
@@ -31,7 +31,7 @@ SERIAL = 0
 if RELEASELEVEL == 0x0f:  # pragma: no cover
     #: version
     version = '%d.%d.%d' % (MAJOR, MINOR, MICRO)  # lgtm[py/unreachable-statement]
-elif RELEASELEVEL == 0x00:  # pragma: no cover
+elif RELEASELEVEL == 0x00:  # pragma: no cover  lgtm[py/unreachable-statement]
     version = '%d.%d.%ddev%d' % (MAJOR, MINOR, MICRO, SERIAL)  # lgtm[py/unreachable-statement]
 elif RELEASELEVEL == 0x0c:  # pragma: no cover
     version = '%d.%d.%drc%d' % (MAJOR, MINOR, MICRO, SERIAL)  # lgtm[py/unreachable-statement]