summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Lee <lee218@llnl.gov>2017-03-27 10:56:55 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2017-03-27 10:56:55 -0700
commit8a873bbd8d7c64d1070c01b5bd1a38971350457a (patch)
tree11b24719cc31da2d84da144b8b233f60c7427884
parent625a1634bbd8e75e2034e7214735937de063076c (diff)
downloadspack-8a873bbd8d7c64d1070c01b5bd1a38971350457a.tar.gz
spack-8a873bbd8d7c64d1070c01b5bd1a38971350457a.tar.bz2
spack-8a873bbd8d7c64d1070c01b5bd1a38971350457a.tar.xz
spack-8a873bbd8d7c64d1070c01b5bd1a38971350457a.zip
Fix easy-install.pth syntax (#3569)
-rw-r--r--var/spack/repos/builtin/packages/python/package.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
index 15f7f4f987..15bdbbc4d1 100644
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -470,19 +470,10 @@ class Python(Package):
else:
with closing(open(main_pth, 'w')) as f:
- f.write("""
-import sys
-sys.__plen = len(sys.path)
-""")
+ f.write("import sys; sys.__plen = len(sys.path)")
for path in paths:
f.write("{0}\n".format(path))
- f.write("""
-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)
-""")
+ 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
def activate(self, ext_pkg, **args):
ignore = self.python_ignore(ext_pkg, args)