Patch response checking in promptForFlushDnsCache
authorgfyoung <redacted>
Mon, 8 May 2017 05:08:28 +0000 (01:08 -0400)
committergfyoung <redacted>
Mon, 8 May 2017 05:10:40 +0000 (01:10 -0400)
Previously, it was checking if query_yes_no returned
False, which does not happen, as the function only
returns "yes" or "no". As a result, the check was
always returning True, even when the user did not
want to flush the DNS cache.

updateHostsFile.py

index ef0dcd00b272040dbe977e62a1ac5e104945b1ba..2c6444fd2f6cc44c6968e5f53e1e140be1920784 100644 (file)
@@ -191,11 +191,13 @@ def promptForMoreCustomExclusions(question="Do you have more domains you want to
 
 
 def promptForFlushDnsCache():
-    if settings['auto']:
-        if settings['flushdnscache']:
-            flushDnsCache()
-    else:
-        if settings['flushdnscache'] or query_yes_no("Attempt to flush the DNS cache?"):
+    if settings["flushdnscache"]:
+        flushDnsCache()
+
+    if not settings["auto"]:
+        response = query_yes_no("Attempt to flush the DNS cache?")
+
+        if response == "yes":
             flushDnsCache()
 
 
git clone https://git.99rst.org/PROJECT