From: Bob Halley Date: Tue, 30 May 2017 19:22:54 +0000 (-0700) Subject: Fix more latest pylint warnings. X-Git-Tag: v1.16.0~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=587d019f5fbd98eb7d84bc0bcbf87c2b606a9df5;p=thirdparty%2Fdnspython.git Fix more latest pylint warnings. --- diff --git a/Makefile b/Makefile index 845abd3d..ca37045a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2003-2007, 2009, 2011 Nominum, Inc. +# Copyright (C) 2003-2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, @@ -67,3 +67,6 @@ test3: lint: pylint dns tests examples/*.py + +lint3: + pylint3 dns tests examples/*.py diff --git a/dns/name.py b/dns/name.py index 7537792e..9c7e2713 100644 --- a/dns/name.py +++ b/dns/name.py @@ -32,6 +32,7 @@ import dns.wiredata from ._compat import long, binary_type, text_type, unichr, maybe_decode +# pylint: disable=sys-max-int try: maxint = sys.maxint except AttributeError: diff --git a/dns/rdtypes/ANY/NSEC3.py b/dns/rdtypes/ANY/NSEC3.py index 9a15687b..40564685 100644 --- a/dns/rdtypes/ANY/NSEC3.py +++ b/dns/rdtypes/ANY/NSEC3.py @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2007, 2009-2011 Nominum, Inc. +# Copyright (C) 2004-2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, @@ -23,6 +23,8 @@ import dns.rdata import dns.rdatatype from dns._compat import xrange, text_type +# pylint: disable=deprecated-string-function + try: b32_hex_to_normal = string.maketrans('0123456789ABCDEFGHIJKLMNOPQRSTUV', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567') diff --git a/dns/rdtypes/IN/APL.py b/dns/rdtypes/IN/APL.py index ac9c1f02..b4c0bfa0 100644 --- a/dns/rdtypes/IN/APL.py +++ b/dns/rdtypes/IN/APL.py @@ -1,4 +1,4 @@ -# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. +# Copyright (C) 2003-2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, @@ -121,6 +121,10 @@ class APL(dns.rdata.Rdata): @classmethod def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None): + + # pylint complains about this on Python 2.7, not sure why... + # pylint: disable=invalid-str-codec + items = [] while 1: if rdlen == 0: diff --git a/pylintrc b/pylintrc index 8a8ec2a5..bdb82db0 100644 --- a/pylintrc +++ b/pylintrc @@ -12,7 +12,8 @@ enable= python3 # It's worth looking at len-as-condition for optimization, but it's disabled -# here as it is not a correctness thing. +# here as it is not a correctness thing. Similarly eq-without-hash is +# probably worth improving. disable= R, @@ -38,6 +39,7 @@ disable= wrong-import-order, wrong-import-position, len-as-condition, + eq-without-hash, [REPORTS] diff --git a/tests/test_resolver.py b/tests/test_resolver.py index cf72f722..cd7b8c3e 100644 --- a/tests/test_resolver.py +++ b/tests/test_resolver.py @@ -275,7 +275,7 @@ if hasattr(select, 'poll'): class NXDOMAINExceptionTestCase(unittest.TestCase): - # pylint: disable=broad-except + # pylint: disable=broad-except,exception-message-attribute def test_nxdomain_compatible(self): n1 = dns.name.Name(('a', 'b', ''))