From: Evan Hunt Date: Fri, 29 Apr 2016 17:38:35 +0000 (-0700) Subject: [master] address some python2/3 incompatibilities X-Git-Tag: v9.11.0a2~65 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=304d16f08fd7373dd61a43561fe6400ddda3f46f;p=thirdparty%2Fbind9.git [master] address some python2/3 incompatibilities --- diff --git a/bin/python/isc/dnskey.py b/bin/python/isc/dnskey.py index 10c14b96640..fa7e9c4a3df 100644 --- a/bin/python/isc/dnskey.py +++ b/bin/python/isc/dnskey.py @@ -48,8 +48,7 @@ class dnskey: self.fromtuple(name, alg, keyid, keyttl) self._dir = directory or os.path.dirname(key) or '.' - key = os.path.basename(key) - + key = os.path.basename(key).decode('ascii') (name, alg, keyid) = key.split('+') name = name[1:-1] alg = int(alg) diff --git a/bin/python/isc/policy.py b/bin/python/isc/policy.py index 3a04d6ab97b..14fd8535daa 100644 --- a/bin/python/isc/policy.py +++ b/bin/python/isc/policy.py @@ -102,7 +102,7 @@ class PolicyLex: def __init__(self, **kwargs): for r in self.reserved: - self.reserved_map[r.lower().translate(maketrans('_', '-'))] = r + self.reserved_map[r.lower().translate(str.maketrans('_', '-'))] = r self.lexer = lex.lex(object=self, **kwargs) def test(self, text):