Fix easy-install.pth syntax (#3569)
This commit is contained in:
parent
625a1634bb
commit
8a873bbd8d
@ -470,19 +470,10 @@ def write_easy_install_pth(self, exts):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
with closing(open(main_pth, 'w')) as f:
|
with closing(open(main_pth, 'w')) as f:
|
||||||
f.write("""
|
f.write("import sys; sys.__plen = len(sys.path)")
|
||||||
import sys
|
|
||||||
sys.__plen = len(sys.path)
|
|
||||||
""")
|
|
||||||
for path in paths:
|
for path in paths:
|
||||||
f.write("{0}\n".format(path))
|
f.write("{0}\n".format(path))
|
||||||
f.write("""
|
f.write("import sys; new = sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p = getattr(sys, '__egginsert', 0); sys.path[p:p] = new; sys.__egginsert = p + len(new)") # noqa: E501
|
||||||
new = sys.path[sys.__plen:]
|
|
||||||
del sys.path[sys.__plen:]
|
|
||||||
p = getattr(sys, '__egginsert', 0)
|
|
||||||
sys.path[p:p] = new
|
|
||||||
sys.__egginsert = p + len(new)
|
|
||||||
""")
|
|
||||||
|
|
||||||
def activate(self, ext_pkg, **args):
|
def activate(self, ext_pkg, **args):
|
||||||
ignore = self.python_ignore(ext_pkg, args)
|
ignore = self.python_ignore(ext_pkg, args)
|
||||||
|
Loading…
Reference in New Issue
Block a user