diff options
author | Nathan Henrie <nate@n8henrie.com> | 2016-05-14 15:28:58 -0600 |
---|---|---|
committer | Nathan Henrie <nate@n8henrie.com> | 2016-05-14 15:28:58 -0600 |
commit | 6eff53b229a525ed434b5ce78e43709c0b069a9c (patch) | |
tree | 9fe04645df13f17a2988b44da69f8ef71f260e2b /dns | |
parent | f99a01bf3028bd460db50ac57e040176f7ddf295 (diff) | |
download | dnspython-6eff53b229a525ed434b5ce78e43709c0b069a9c.tar.gz |
Explicitly use bytes to avoid TypeError with concatenation
Fixes rthalley/dnspython#157
On Python3, this previously would raise a TypeError when one tried to
add bytes and a string, this initializes s and n to bytes instead.
Diffstat (limited to 'dns')
-rw-r--r-- | dns/query.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dns/query.py b/dns/query.py index cfa3f17..71fa38c 100644 --- a/dns/query.py +++ b/dns/query.py @@ -264,11 +264,11 @@ def _net_read(sock, count, expiration): A Timeout exception will be raised if the operation is not completed by the expiration time. """ - s = '' + s = b'' while count > 0: _wait_for_readable(sock, expiration) n = sock.recv(count) - if n == '': + if n == b'': raise EOFError count = count - len(n) s = s + n |