aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-13 21:09:49 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-13 21:09:49 -0500
commitd9125bcb60fa2e1a5270259dad6b6a94c8f61cde (patch)
tree812a5ac693d8230774cf1ee33f0ab4170701552d
parentbffd26f485964e1cfb881ccf85179b2947d5e734 (diff)
downloadexternal_python_setuptools-d9125bcb60fa2e1a5270259dad6b6a94c8f61cde.tar.gz
external_python_setuptools-d9125bcb60fa2e1a5270259dad6b6a94c8f61cde.tar.bz2
external_python_setuptools-d9125bcb60fa2e1a5270259dad6b6a94c8f61cde.zip
As sometimes orig_path may be something other than a list (i.e. _NamespacePath), use iterator tools to sort the items in place. Fixes #885.
-rw-r--r--pkg_resources/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 92503288..d0f66274 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2113,7 +2113,7 @@ def _rebuild_mod_path(orig_path, package_name, module):
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]