diff options
author | Elizabeth F <rpf2116@columbia.edu> | 2016-03-13 18:04:23 -0400 |
---|---|---|
committer | Elizabeth F <rpf2116@columbia.edu> | 2016-03-13 18:04:23 -0400 |
commit | 030e8dd1ac7c23cfdd9bf7983caec6f8ca41a556 (patch) | |
tree | 3cf2f5d6b0d8599ae79f84ea441b76e01198170e | |
parent | 4c9a52044a89ef8133ab2ac1759da9d4caefa3eb (diff) | |
download | spack-030e8dd1ac7c23cfdd9bf7983caec6f8ca41a556.tar.gz spack-030e8dd1ac7c23cfdd9bf7983caec6f8ca41a556.tar.bz2 spack-030e8dd1ac7c23cfdd9bf7983caec6f8ca41a556.tar.xz spack-030e8dd1ac7c23cfdd9bf7983caec6f8ca41a556.zip |
Removed Python 2.7-style string formatting
-rw-r--r-- | lib/spack/spack/package.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index f815628bba..10f0c4e761 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1401,7 +1401,7 @@ class CMakePackage(StagedPackage): spconfig_fname = 'spconfig.py' with open(spconfig_fname, 'w') as fout: fout.write(\ -r"""#!{} +r"""#!%s # import sys @@ -1411,28 +1411,28 @@ import subprocess def cmdlist(str): return list(x.strip().replace("'",'') for x in str.split('\n') if x) env = dict() -""".format(sys.executable)) +""" % sys.executable) env_vars = sorted(list(env.keys())) for name in env_vars: val = env[name] if string.find(name, 'PATH') < 0: - fout.write('env[{}] = {}\n'.format(repr(name),repr(val))) + fout.write('env[%s] = %s\n'. % (repr(name),repr(val))) else: if name == 'CMAKE_TRANSITIVE_INCLUDE_PATH': sep = ';' else: sep = ':' - fout.write('env[{}] = "{}".join(cmdlist("""\n'.format(repr(name),sep)) + fout.write('env[%s] = "%s".join(cmdlist("""\n' % (repr(name),sep)) for part in string.split(val, sep): - fout.write(' {}\n'.format(part)) + fout.write(' %s\n' % part) fout.write('"""))\n') fout.write('\ncmd = cmdlist("""\n') - fout.write('{}\n'.format(cmd[0])) + fout.write('%s\n' % cmd[0]) for arg in cmd[1:]: - fout.write(' {}\n'.format(arg)) + fout.write(' %s\n' % arg) fout.write('""") + sys.argv[1:]\n') fout.write('\nproc = subprocess.Popen(cmd, env=env)\nproc.wait()\n') make_executable(spconfig_fname) |