code cleanup
This commit is contained in:
parent
b0b3426b0f
commit
508731319a
@ -25,6 +25,8 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
import dns.rdatatype
|
||||
import dns.resolver
|
||||
import getopt
|
||||
import os
|
||||
import signal
|
||||
@ -32,9 +34,6 @@ import sys
|
||||
import time
|
||||
from statistics import stdev
|
||||
|
||||
import dns.rdatatype
|
||||
import dns.resolver
|
||||
|
||||
__VERSION__ = 1.0
|
||||
__PROGNAME__ = os.path.basename(sys.argv[0])
|
||||
should_stop = False
|
||||
|
@ -111,8 +111,6 @@ def main():
|
||||
|
||||
icmp = socket.getprotobyname('icmp')
|
||||
|
||||
response_time = []
|
||||
i = 0
|
||||
ttl = 1
|
||||
reached = False
|
||||
|
||||
@ -128,7 +126,7 @@ def main():
|
||||
|
||||
try: # send DNS request
|
||||
stime = time.time()
|
||||
answers = resolver.query(hostname, dnsrecord, ipttl=ttl)
|
||||
resolver.query(hostname, dnsrecord, ipttl=ttl)
|
||||
except dns.resolver.NoNameservers as e:
|
||||
if not quiet:
|
||||
print("no or bad response:", e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user