forked from VimPlug/jedi
In the previous implementation, Jedi would's traverse_parents function traversed parent directories to the system root every time. This would inadvertently add every folder to the system root every time. Obviously, this is not the behavior desired for the import system. This pull request provides a new argument to the traverse_parents function, "root", which represents the root parent for the search. This argument defaults to None, thereby preserving the existing behavior of the function. I chose to duplicate some code for performance reasons. Since I'm trying to avoid too much path manipulation magic, we do: * a search to a valid specified root, OR * a simple upward search until hitting the system root when there is no valid root specified.