summaryrefslogtreecommitdiff
path: root/pkg_resources.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2006-04-14 19:13:24 +0000
committerPJ Eby <distutils-sig@python.org>2006-04-14 19:13:24 +0000
commit52dcb6d1c888a4a7a047f380783f572055a175dc (patch)
treee7f74685afa9a96c1c8b6658f2bba093b66813d6 /pkg_resources.py
parent2fbffe9bf4bf6c71c5bbe94e3386d69a2db5f37c (diff)
downloadpython-setuptools-git-52dcb6d1c888a4a7a047f380783f572055a175dc.tar.gz
Don't eagerly import namespace packages. This was the big reason for
branching to 0.7 now, as I wanted this wart gone before anything went into Python 2.5. But it's gone now, yay! --HG-- extra : source : f3c5c19842064dd4a497baef0171aac54464a484 extra : amend_source : 3f79e71eedfc5f37a1813967bb53cf9d92a11919
Diffstat (limited to 'pkg_resources.py')
-rw-r--r--pkg_resources.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index 2a47c58b..2d656f1a 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -2311,7 +2311,9 @@ class Distribution(object):
self.insert_on(path)
if path is sys.path:
fixup_namespace_packages(self.location)
- list(map(declare_namespace, self._get_metadata('namespace_packages.txt')))
+ for pkg in self._get_metadata('namespace_packages.txt'):
+ if pkg in sys.modules:
+ declare_namespace(pkg)
def egg_name(self):
"""Return what this distribution's standard .egg filename should be"""