mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
0d0d7e35b3
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).
26 lines
642 B
Python
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()
|