diff --git a/pip/_vendor/cachecontrol/filewrapper.py b/pip/_vendor/cachecontrol/filewrapper.py index e35b2f6f022f54ef47e491ce96b09f868d012035..3989bbe92b27d1cf25ac7fccd9e633af03305b29 100644 --- a/pip/_vendor/cachecontrol/filewrapper.py +++ b/pip/_vendor/cachecontrol/filewrapper.py @@ -32,4 +32,11 @@ class CallbackFileWrapper(object): if is_fp_closed(self.__fp): self.__callback(self.__buf.getvalue()) + # We assign this to None here, because otherwise we can get into + # really tricky problems where the CPython interpreter dead locks + # because the callback is holding a reference to something which + # has a __del__ method. Setting this to None breaks the cycle + # and allows the garbage collector to do it's thing normally. + self.__callback = None + return data diff --git a/pip/_vendor/vendor.txt b/pip/_vendor/vendor.txt index 74c3a794efe07af2d30ef4952ff376dafb72c99a..c19a851ebeaa90ed0eb0f34ef345cd635971b623 100644 --- a/pip/_vendor/vendor.txt +++ b/pip/_vendor/vendor.txt @@ -3,5 +3,5 @@ html5lib==1.0b3 six==1.6.1 colorama==0.3.1 requests==2.3.0 -CacheControl==0.10.1 +CacheControl==0.10.2 lockfile==0.9.1