diff options
| author | Bob Halley <halley@dnspython.org> | 2020-06-18 09:00:30 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-06-18 09:00:30 -0700 |
| commit | bb87ef59022d3bd7df6db6be7de20c8ba6d60d6b (patch) | |
| tree | 7e44d34e82079c7ca2355a91f28f330fac534e0d /dns | |
| parent | a26802bf9530b071f483616897b27b3fed85f30a (diff) | |
| download | dnspython-bb87ef59022d3bd7df6db6be7de20c8ba6d60d6b.tar.gz | |
improve query coverage
Diffstat (limited to 'dns')
| -rw-r--r-- | dns/query.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/dns/query.py b/dns/query.py index 05796f8..2a1e7cc 100644 --- a/dns/query.py +++ b/dns/query.py @@ -40,8 +40,8 @@ try: from requests_toolbelt.adapters.source import SourceAddressAdapter from requests_toolbelt.adapters.host_header_ssl import HostHeaderSSLAdapter have_doh = True -except ImportError: - have_doh = False # pragma: no cover +except ImportError: # pragma: no cover + have_doh = False try: import ssl @@ -158,7 +158,7 @@ def _wait_for(fd, readable, writable, error, expiration): return True if not _polling_backend(fd, readable, writable, error, timeout): raise dns.exception.Timeout - except OSError as e: + except OSError as e: # pragma: no cover if e.args[0] != errno.EINTR: raise e done = True @@ -177,7 +177,7 @@ if hasattr(select, 'poll'): # be more efficient for high values). _polling_backend = _poll_for else: - _polling_backend = _select_for + _polling_backend = _select_for # pragma: no cover def _wait_for_readable(s, expiration): @@ -304,7 +304,7 @@ def https(q, where, timeout=None, port=443, source=None, source_port=0, """ if not have_doh: - raise NoDOH + raise NoDOH # pragma: no cover wire = q.to_wire() (af, destination, source) = _destination_and_source(where, port, @@ -579,9 +579,9 @@ def _net_read(sock, count, expiration): _wait_for_readable(sock, expiration) try: n = sock.recv(count) - except ssl.SSLWantReadError: + except ssl.SSLWantReadError: # pragma: no cover continue - except ssl.SSLWantWriteError: + except ssl.SSLWantWriteError: # pragma: no cover _wait_for_writable(sock, expiration) continue if n == b'': @@ -602,10 +602,10 @@ def _net_write(sock, data, expiration): _wait_for_writable(sock, expiration) try: current += sock.send(data[current:]) - except ssl.SSLWantReadError: + except ssl.SSLWantReadError: # pragma: no cover _wait_for_readable(sock, expiration) continue - except ssl.SSLWantWriteError: + except ssl.SSLWantWriteError: # pragma: no cover continue @@ -748,7 +748,7 @@ def _tls_handshake(s, expiration): return except ssl.SSLWantReadError: _wait_for_readable(s, expiration) - except ssl.SSLWantWriteError: + except ssl.SSLWantWriteError: # pragma: no cover _wait_for_writable(s, expiration) |
