diff options
| author | Bob Halley <halley@dnspython.org> | 2018-12-09 12:06:24 -0800 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2018-12-09 12:06:24 -0800 |
| commit | 129f9e79ff508e36bac08fd588769525d9214a57 (patch) | |
| tree | 8d5c0dc44ef1e232d1e87e38f1c777aba74c81ff /dns/tokenizer.py | |
| parent | a0a975bc26728996313425ad4ba8b1281849153c (diff) | |
| download | dnspython-129f9e79ff508e36bac08fd588769525d9214a57.tar.gz | |
Remove _compat module.
Diffstat (limited to 'dns/tokenizer.py')
| -rw-r--r-- | dns/tokenizer.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/dns/tokenizer.py b/dns/tokenizer.py index 880b71c..74674a6 100644 --- a/dns/tokenizer.py +++ b/dns/tokenizer.py @@ -23,7 +23,6 @@ import sys import dns.exception import dns.name import dns.ttl -from ._compat import long, text_type, binary_type _DELIMITERS = { ' ': True, @@ -189,11 +188,11 @@ class Tokenizer(object): will return. """ - if isinstance(f, text_type): + if isinstance(f, str): f = StringIO(f) if filename is None: filename = '<string>' - elif isinstance(f, binary_type): + elif isinstance(f, bytes): f = StringIO(f.decode()) if filename is None: filename = '<string>' @@ -497,8 +496,8 @@ class Tokenizer(object): raise dns.exception.SyntaxError('expecting an identifier') if not token.value.isdigit(): raise dns.exception.SyntaxError('expecting an integer') - value = long(token.value) - if value < 0 or value > long(4294967296): + value = int(token.value) + if value < 0 or value > 4294967296: raise dns.exception.SyntaxError( '%d is not an unsigned 32-bit integer' % value) return value |
