pypa/pip — pull request #1230 by mgood (2013-10-09 23:34:03+00:00)
Title: Don't double "remove" an item from "dirs"

Use "elif" to only call `dirs.remove(dir)` once if both conditions are true. This is possible if a virtualenv called "test" is present, so both "test/bin/python" exists, and `dir == 'test'`. It would execute `dirs.remove('test')` twice, the second time raising an exception.