From e555b6242d32950ac4b8a9a90a6d78461c45d901 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Mon, 21 Feb 2022 14:31:39 -0800 Subject: [PATCH] more lgtm lint --- dns/asyncbackend.py | 3 +-- dns/rdataset.py | 12 ++++++++---- dns/version.py | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dns/asyncbackend.py b/dns/asyncbackend.py index aef14b55..ad79a572 100644 --- a/dns/asyncbackend.py +++ b/dns/asyncbackend.py @@ -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 diff --git a/dns/rdataset.py b/dns/rdataset.py index 8da7f2b9..e6e95480 100644 --- a/dns/rdataset.py +++ b/dns/rdataset.py @@ -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): diff --git a/dns/version.py b/dns/version.py index 1f54521d..1a503ad7 100644 --- a/dns/version.py +++ b/dns/version.py @@ -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] -- 2.47.3