Commit 304d16f0 authored by Evan Hunt's avatar Evan Hunt
Browse files

[master] address some python2/3 incompatibilities

parent 17e9d602
...@@ -48,8 +48,7 @@ class dnskey: ...@@ -48,8 +48,7 @@ class dnskey:
self.fromtuple(name, alg, keyid, keyttl) self.fromtuple(name, alg, keyid, keyttl)
self._dir = directory or os.path.dirname(key) or '.' 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, alg, keyid) = key.split('+')
name = name[1:-1] name = name[1:-1]
alg = int(alg) alg = int(alg)
......
...@@ -102,7 +102,7 @@ class PolicyLex: ...@@ -102,7 +102,7 @@ class PolicyLex:
def __init__(self, **kwargs): def __init__(self, **kwargs):
for r in self.reserved: 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) self.lexer = lex.lex(object=self, **kwargs)
def test(self, text): def test(self, text):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment