Skip to content

Commit

Permalink
Cope with ssl module unavailablity using [Issue #392] method.
Browse files Browse the repository at this point in the history
  • Loading branch information
rthalley committed Oct 23, 2019
1 parent 1ede966 commit 7daaffc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dns/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import os
import select
import socket
import ssl
import struct
import sys
import time
Expand All @@ -36,6 +35,19 @@
import dns.rdataclass
import dns.rdatatype

try:
import ssl
except ImportError:
class ssl(object):
class WantReadException(Exception):
pass
class WantWriteException(Exception):
pass
class SSLSocket(object):
pass
def create_default_context(self, *args, **kwargs):
raise Exception('no ssl support')

# Function used to create a socket. Can be overridden if needed in special
# situations.
socket_factory = socket.socket
Expand Down

0 comments on commit 7daaffc

Please sign in to comment.