diff --git a/pex/http.py b/pex/http.py index ac7001eaf..6396ff8c3 100644 --- a/pex/http.py +++ b/pex/http.py @@ -23,6 +23,12 @@ try: from cachecontrol import CacheControl from cachecontrol.caches import FileCache + + # Newer versions of CacheControl move the importing of `lockfile` to + # class instansiation, and raise an ImportError in the __init__ method. + # + # https://github.com/ionrock/cachecontrol/commit/a561ac9c1ef15db9bc6ead5d08443e6198cc69e1 + FileCache(directory=None) # noqa except ImportError: CacheControl = FileCache = None