File tree 1 file changed +0
-21
lines changed 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change 8
8
import base64
9
9
import sys
10
10
import os
11
-
12
- #
13
- # RATIONALE:
14
- # This script is both it's own "host" and "guest". If it's running in "guest
15
- # mode" (inside the virtualenv interpreter), it's essentially invoked via:
16
- # /path/to/python /path/to/this/script.py
17
- #
18
- # Which, by the nature of Python, will put `/path/to/this` on the system path
19
- # as the first argument. Now this can cause many subtle bugs, because the
20
- # rest of the script is now looking to import from the "host" Python version
21
- # first. This has been especially troublesome when trying to create a Python
22
- # 3 "guest" env using a Python 2 "host", but even with minor Python
23
- # differences, there may been some bleeding between environments that doesn't
24
- # stand out as obviously.
25
- #
26
- # This removes the first argument off the system path, to avoid any accidental
27
- # usage of the "host" library directories.
28
- #
29
- if os .environ .get ('VIRTUALENV_INTERPRETER_RUNNING' ):
30
- del sys .path [0 ]
31
-
32
11
import codecs
33
12
import optparse
34
13
import re
You can’t perform that action at this time.
0 commit comments