From: gfyoung Date: Mon, 8 May 2017 05:08:28 +0000 (-0400) Subject: Patch response checking in promptForFlushDnsCache X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=bdce1217bbea45c4b56af236b6962aa53c539b54;p=stevenblack-hosts.git Patch response checking in promptForFlushDnsCache 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. --- diff --git a/updateHostsFile.py b/updateHostsFile.py index ef0dcd00b..2c6444fd2 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -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()