diff options
author | PJ Eby <distutils-sig@python.org> | 2005-05-29 05:20:59 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-05-29 05:20:59 +0000 |
commit | 60f18d3c12d44e4a3d0d0d352f3849a582403dc8 (patch) | |
tree | 8588d55b9269b7a53b84d3d64e89e878dd7a3dcc | |
parent | b75164050f0b537611c21e8824020e226ac6c39b (diff) | |
download | external_python_setuptools-60f18d3c12d44e4a3d0d0d352f3849a582403dc8.tar.gz external_python_setuptools-60f18d3c12d44e4a3d0d0d352f3849a582403dc8.tar.bz2 external_python_setuptools-60f18d3c12d44e4a3d0d0d352f3849a582403dc8.zip |
Correctly recognize .egg files that are already on sys.path (or whatever
path AvailableDistributions is scanning)
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041021
-rw-r--r-- | pkg_resources.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index b7826c4b..5d7592eb 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -755,6 +755,15 @@ def find_distributions(path_item): return finder(importer,path_item) +def find_in_zip(importer,path_item): + # for now, we only yield the .egg file itself, if applicable; + # i.e., we don't support "baskets" yet, just eggs + for item in find_on_path(importer,path_item): + yield item + +register_finder(zipimport.zipimporter,find_in_zip) + + def StringIO(*args, **kw): """Thunk to load the real StringIO on demand""" global StringIO @@ -770,13 +779,6 @@ def StringIO(*args, **kw): - - - - - - - def find_nothing(importer,path_item): return () |