From 8803f2806d546ef8cad19ae380b64125a23da897 Mon Sep 17 00:00:00 2001 From: Dan Sully Date: Mon, 30 Jan 2017 09:54:12 -0800 Subject: [PATCH] Fix CacheControl import. --- pex/http.py | 6 ++++++ 1 file changed, 6 insertions(+) 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