From: Martin Date: Fri, 14 Jul 2017 18:17:23 +0000 (+0200) Subject: Pylint: reduce range of pylint disable statement X-Git-Tag: v1.16.0~34^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0db8863e00b2d3464af518b734abb969f95974d5;p=thirdparty%2Fdnspython.git Pylint: reduce range of pylint disable statement If pylint disable statement is used on separate line, it disables the check to the end of module. In that case real errors may be unnoticed. Pylint disable statement can be used per block and per line --- diff --git a/dns/name.py b/dns/name.py index 9c7e2713..9764de5e 100644 --- a/dns/name.py +++ b/dns/name.py @@ -32,9 +32,8 @@ import dns.wiredata from ._compat import long, binary_type, text_type, unichr, maybe_decode -# pylint: disable=sys-max-int try: - maxint = sys.maxint + maxint = sys.maxint # pylint: disable=sys-max-int except AttributeError: maxint = (1 << (8 * struct.calcsize("P"))) // 2 - 1 diff --git a/dns/rdtypes/ANY/NSEC3.py b/dns/rdtypes/ANY/NSEC3.py index 40564685..2e722de2 100644 --- a/dns/rdtypes/ANY/NSEC3.py +++ b/dns/rdtypes/ANY/NSEC3.py @@ -24,7 +24,6 @@ import dns.rdatatype from dns._compat import xrange, text_type # pylint: disable=deprecated-string-function - try: b32_hex_to_normal = string.maketrans('0123456789ABCDEFGHIJKLMNOPQRSTUV', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567') @@ -35,6 +34,7 @@ except AttributeError: b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567') b32_normal_to_hex = bytes.maketrans(b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', b'0123456789ABCDEFGHIJKLMNOPQRSTUV') +# pylint: enable=deprecated-string-function # hash algorithm constants SHA1 = 1