From 9ec3bbc7bcef27123270535c1a3ab7cc9adda95d Mon Sep 17 00:00:00 2001 From: Matthew Iversen Date: Sun, 22 Jun 2014 22:01:17 +1000 Subject: Clean up _get_all_ns_packages --- setuptools/command/install_egg_info.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setuptools/command/install_egg_info.py b/setuptools/command/install_egg_info.py index 411fce6b..578aa3d4 100755 --- a/setuptools/command/install_egg_info.py +++ b/setuptools/command/install_egg_info.py @@ -95,12 +95,11 @@ class install_egg_info(Command): f.close() def _get_all_ns_packages(self): - nsp = {} + """Return sorted list of all package namespaces""" + nsp = set() for pkg in self.distribution.namespace_packages or []: pkg = pkg.split('.') while pkg: - nsp['.'.join(pkg)] = 1 + nsp.add('.'.join(pkg)) pkg.pop() - nsp = list(nsp) - nsp.sort() # set up shorter names first - return nsp + return sorted(nsp) -- cgit v1.2.3