]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
pylint: fix invalid-str-codecs
authorMartin <martin.basti@gmail.com>
Fri, 14 Jul 2017 20:55:25 +0000 (22:55 +0200)
committerMartin <martin.basti@gmail.com>
Fri, 14 Jul 2017 22:58:39 +0000 (00:58 +0200)
dns/rdtypes/IN/APL.py

index b4c0bfa0e0ae5483baff41e9eb8759dc8def8e88..5b9383f64d82365913e6e3ba2576af024f3d126d 100644 (file)
@@ -13,8 +13,9 @@
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-import struct
 import binascii
+import codecs
+import struct
 
 import dns.exception
 import dns.inet
@@ -122,9 +123,6 @@ 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:
@@ -157,7 +155,7 @@ class APL(dns.rdata.Rdata):
                 # This isn't really right according to the RFC, but it
                 # seems better than throwing an exception
                 #
-                address = address.encode('hex_codec')
+                address = codecs.encode(address, 'hex_codec')
             current += afdlen
             rdlen -= afdlen
             item = APLItem(header[0], negation, address, header[1])