From 304d16f08fd7373dd61a43561fe6400ddda3f46f Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 29 Apr 2016 10:38:35 -0700 Subject: [PATCH] [master] address some python2/3 incompatibilities --- bin/python/isc/dnskey.py | 3 +-- bin/python/isc/policy.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/python/isc/dnskey.py b/bin/python/isc/dnskey.py index 10c14b9664..fa7e9c4a3d 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 3a04d6ab97..14fd8535da 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):