Commit d9125bcb authored by Jason R. Coombs's avatar Jason R. Coombs

As sometimes orig_path may be something other than a list (i.e....

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.
parent bffd26f4
......@@ -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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment