diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2016-03-20 15:12:30 -0400 | 
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-03-20 15:12:30 -0400 | 
| commit | 07a1c6988ad6b270a29b1059b7ec71191d67c9bc (patch) | |
| tree | 18d9169b7e9aae0afb0032fcd682f5d6ef85a0d6 | |
| parent | 0ddbf39156d5394442ab604ab4356c4507214749 (diff) | |
| download | python-setuptools-git-07a1c6988ad6b270a29b1059b7ec71191d67c9bc.tar.gz | |
Rename variables for clarity and easier troubleshooting (avoid masking intermediate 'parts' value).
| -rw-r--r-- | pkg_resources/__init__.py | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 03def160..0534f54f 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -2028,12 +2028,13 @@ def _rebuild_mod_path(orig_path, package_name, module):      corresponding to their sys.path order      """      sys_path = [_normalize_cached(p) for p in sys.path] -    def position_in_sys_path(p): +    def position_in_sys_path(path):          """          Return the ordinal of the path based on its position in sys.path          """ -        parts = p.split(os.sep) -        parts = parts[:-(package_name.count('.') + 1)] +        path_parts = path.split(os.sep) +        module_parts = package_name.count('.') + 1 +        parts = path_parts[:-module_parts]          return sys_path.index(_normalize_cached(os.sep.join(parts)))      orig_path.sort(key=position_in_sys_path)  | 
