From 2bd140300eb0aa63b78a930463ca4c81fa2546bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Mon, 2 Jun 2014 16:48:14 +0200 Subject: fix clearing zipimport._zip_directory_cache on pypy pypy uses a custom zipimport._zip_directory_cache implementation class that does not support the complete dict interface, e.g. it does not support the dict.pop() method. For more detailed information see the following links: https://bitbucket.org/pypa/setuptools/issue/202/more-robust-zipimporter-cache-invalidation#comment-10495960 https://bitbucket.org/pypy/pypy/src/dd07756a34a41f674c0cacfbc8ae1d4cc9ea2ae4/pypy/module/zipimport/interp_zipimport.py#cl-99 --HG-- extra : rebase_source : 95cff7946455f0a4422d97eecab11164a9ddef10 --- setuptools/command/easy_install.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 0bce4ab9..81158c43 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1678,7 +1678,14 @@ def _replace_zip_directory_cache_data(normalized_path): # documented anywhere and could in theory change with new Python releases) # for no significant benefit. for p in to_update: - old_entry = cache.pop(p) + # N.B. pypy uses a custom zipimport._zip_directory_cache implementation + # class that does not support the complete dict interface, e.g. it does + # not support the dict.pop() method. For more detailed information see + # the following links: + # https://bitbucket.org/pypa/setuptools/issue/202/more-robust-zipimporter-cache-invalidation#comment-10495960 + # https://bitbucket.org/pypy/pypy/src/dd07756a34a41f674c0cacfbc8ae1d4cc9ea2ae4/pypy/module/zipimport/interp_zipimport.py#cl-99 + old_entry = cache[p] + del cache[p] zipimport.zipimporter(p) old_entry.clear() old_entry.update(cache[p]) -- cgit v1.2.1