Skip to content

Commit

Permalink
As sometimes orig_path may be something other than a list (i.e. _Name…
Browse files Browse the repository at this point in the history
…spacePath), use iterator tools to sort the items in place. Fixes #885.
  • Loading branch information
jaraco committed Dec 14, 2016
1 parent bffd26f commit d9125bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,7 @@ def position_in_sys_path(path):
parts = path_parts[:-module_parts]
return safe_sys_path_index(_normalize_cached(os.sep.join(parts)))

orig_path.sort(key=position_in_sys_path)
orig_path[:] = sorted(orig_path, key=position_in_sys_path)
module.__path__[:] = [_normalize_cached(p) for p in orig_path]


Expand Down

0 comments on commit d9125bc

Please sign in to comment.