Files
pipenv/pipenv/__init__.py
T
Tzu-ping Chung 0d0d7e35b3 Improve resolver path-patching
Add the parent site-packages directory to sys.path *after* built-in
ones, and only when it does not already exist.

This should vastly improve the resolver's robustness against hostile
Python environments, such as #1753. It might help with issues like #693
as well, but I'm not sure (and not interested in figuring out either).
2018-03-17 10:08:07 +08:00

26 lines
642 B
Python

# |~~\' |~~
# |__/||~~\|--|/~\\ /
# | ||__/|__| |\/
# |
import os
import sys
PIPENV_ROOT = os.path.dirname(os.path.realpath(__file__))
PIPENV_VENDOR = os.sep.join([PIPENV_ROOT, 'vendor'])
PIPENV_PATCHED = os.sep.join([PIPENV_ROOT, 'patched'])
# Inject vendored directory into system path.
sys.path.insert(0, PIPENV_VENDOR)
# Inject patched directory into system path.
sys.path.insert(0, PIPENV_PATCHED)
# Hack to make things work better.
try:
if 'concurrency' in sys.modules:
del sys.modules['concurrency']
except Exception:
pass
from .cli import cli
from . import resolver
if __name__ == '__main__':
cli()