Skip to content

Commit 8a873bb

Browse files
lee218llnltgamblin
authored andcommitted
Fix easy-install.pth syntax (#3569)
1 parent 625a163 commit 8a873bb

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

var/spack/repos/builtin/packages/python/package.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -470,19 +470,10 @@ def write_easy_install_pth(self, exts):
470470

471471
else:
472472
with closing(open(main_pth, 'w')) as f:
473-
f.write("""
474-
import sys
475-
sys.__plen = len(sys.path)
476-
""")
473+
f.write("import sys; sys.__plen = len(sys.path)")
477474
for path in paths:
478475
f.write("{0}\n".format(path))
479-
f.write("""
480-
new = sys.path[sys.__plen:]
481-
del sys.path[sys.__plen:]
482-
p = getattr(sys, '__egginsert', 0)
483-
sys.path[p:p] = new
484-
sys.__egginsert = p + len(new)
485-
""")
476+
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
486477

487478
def activate(self, ext_pkg, **args):
488479
ignore = self.python_ignore(ext_pkg, args)

0 commit comments

Comments
 (0)