From c8b4dc0466a375bd4635396aa235843c08f5ca7a Mon Sep 17 00:00:00 2001 From: "Tom X. Tobin" Date: Sun, 14 Sep 2014 17:15:50 -0400 Subject: [PATCH] Fix internet() test function The change in commit 6989713 broke the internet() test function by trying to access the DNS port of "www.google.de", causing it to always return False, which in turn broke all modules calling it. We instead use the actual domain name of Google's DNS server at IP "8.8.8.8". --- i3pystatus/core/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/i3pystatus/core/util.py b/i3pystatus/core/util.py index 549f053..f404aa5 100644 --- a/i3pystatus/core/util.py +++ b/i3pystatus/core/util.py @@ -353,12 +353,13 @@ def require(predicate): def internet(): """ - Checks for a internet connection by connecting to 8.8.8.8 (Google DNS) + Checks for a internet connection by connecting to a Google DNS + server. :returns: True if internet connection is available """ try: - socket.create_connection(("www.google.de", 53), 1).close() + socket.create_connection(("google-public-dns-a.google.com", 53), 1).close() return True except OSError: return False