[Git][NTPsec/ntpsec][master] ntpdig: Try to handle gaierror better ...

Richard Laager gitlab at mg.gitlab.com
Mon Feb 1 19:53:21 UTC 2021



Richard Laager pushed to branch master at NTPsec / ntpsec


Commits:
2ae1199c by James Browning at 2021-02-01T19:44:19+00:00
ntpdig: Try to handle gaierror better ...

to replicate "ntpdig example.tld" without the quotes.
only symptomatic on Python 3.

- - - - -


1 changed file:

- ntpclients/ntpdig.py


Changes:

=====================================
ntpclients/ntpdig.py
=====================================
@@ -84,7 +84,7 @@ def queryhost(server, concurrent, timeout=5, port=123):
                                       af, socket.SOCK_DGRAM,
                                       socket.IPPROTO_UDP)
     except socket.gaierror as e:
-        log("lookup of %s failed, errno %d = %s" % (server, e[0], e[1]))
+        log("lookup of %s failed, errno %d = %s" % (server, e.args[0], e.args[1]))
         return []
     sockets = []
     packets = []



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/2ae1199c9f495ce7680027a34f4f5609e8a518c4

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/2ae1199c9f495ce7680027a34f4f5609e8a518c4
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20210201/7bd31063/attachment.htm>


More information about the vc mailing list