Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure all pip._vendor.* modules are mapped to debundled corresponden…
…ces (#6113) With the original `vendored()` implementation and such an initialization sequence: ``` vendored("packaging") vendored("packaging.version") ``` In `sys.modules`, `pip._vendor.packaging` is correctly connected to the debundled `packaging`, while `pip._vendor.packaging.version` is not, as the latter is `__import__`ed from the existing `pip._vendor.packaging` module. That results in the same issue as #5429 - `pip._vendor.packaging.version.Version` and `packaging.version.Version` cannot be compared. This patch attempts to fix this issue by skipping `__import__` from the vendored name. This is safe because `vendored()` is called only when `DEBUNDLED = True`, and vendored libraries are already deleted as per [debundling instructions](https://github.com/pypa/pip/blob/master/src/pip/_vendor/README.rst#debundling).
- Loading branch information