1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Added a comment explaining how __main__.py gets teh wheel name

This commit is contained in:
Paul Moore 2014-02-19 09:33:51 +00:00
parent 2b75d510f9
commit 77be5e914e

View file

@ -4,6 +4,10 @@ import sys
# This allows the usage python pip-*.whl/pip install pip-*.whl
if __package__ == '':
import os
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off '/pip'
# Resulting path is the name of the wheel itself
# Add that to sys.path so we can import pip
path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, path)