Skip to content

Commit

Permalink
Merge pull request #64 from mpkuth/disable-tld-cache
Browse files Browse the repository at this point in the history
disable tldextract caching
  • Loading branch information
carsonyl authored Nov 9, 2022
2 parents 6f97b35 + 1711e9d commit 9cfc959
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pypac/wpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
logger = logging.getLogger(__name__)

# First use of tldextract goes online to update its Public Suffix List cache. Stop it.
no_fetch_extract = tldextract.TLDExtract(suffix_list_urls=None)
try:
no_fetch_extract = tldextract.TLDExtract(cache_dir=None, suffix_list_urls=None)
except TypeError:
# tldextract added cache_dir in v3.0.0, which also dropped PY27 support.
# Maintain PY27 support / allow old tldextract by retrying here.
no_fetch_extract = tldextract.TLDExtract(suffix_list_urls=None)


def proxy_urls_from_dns(local_hostname=None):
Expand Down

0 comments on commit 9cfc959

Please sign in to comment.