From b3bf461294d6730617a04e2e6191c14e6a66d79e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 23 Mar 2014 11:24:40 -0400 Subject: Move the transform operation into the generator expression. --- setuptools/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'setuptools') diff --git a/setuptools/__init__.py b/setuptools/__init__.py index ab1541d7..6f588962 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -69,13 +69,11 @@ class PackageFinder(object): def _find_packages_iter(cls, base_path): dirs = cls._all_dirs(base_path) suitable = filterfalse(lambda n: '.' in n, dirs) - packages = ( - path + return ( + path.replace(os.path.sep, '.') for path in suitable if cls._looks_like_package(os.path.join(base_path, path)) ) - for pkg_path in packages: - yield pkg_path.replace(os.path.sep, '.') @staticmethod def _looks_like_package(path): -- cgit v1.2.1