Commit 9ec3bbc7 authored by Matthew Iversen's avatar Matthew Iversen

Clean up _get_all_ns_packages

parent 92683cba
...@@ -95,12 +95,11 @@ class install_egg_info(Command): ...@@ -95,12 +95,11 @@ class install_egg_info(Command):
f.close() f.close()
def _get_all_ns_packages(self): def _get_all_ns_packages(self):
nsp = {} """Return sorted list of all package namespaces"""
nsp = set()
for pkg in self.distribution.namespace_packages or []: for pkg in self.distribution.namespace_packages or []:
pkg = pkg.split('.') pkg = pkg.split('.')
while pkg: while pkg:
nsp['.'.join(pkg)] = 1 nsp.add('.'.join(pkg))
pkg.pop() pkg.pop()
nsp = list(nsp) return sorted(nsp)
nsp.sort() # set up shorter names first
return nsp
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment