Do not use string module to be compatible with python 3 (#248) (#10667)

`string.find` is not part of Python 3 anymore.
This commit is contained in:
Tristan Carel 2019-03-13 02:34:47 +01:00 committed by Adam J. Stewart
parent 3d7164c13f
commit c3662492de

View file

@ -6,7 +6,6 @@
import argparse
import copy
import os
import string
import sys
import llnl.util.tty as tty
@ -85,7 +84,7 @@ def cmdlist(str):
env_vars = sorted(list(env.keys()))
for name in env_vars:
val = env[name]
if string.find(name, 'PATH') < 0:
if name.find('PATH') < 0:
fout.write('env[%s] = %s\n' % (repr(name), repr(val)))
else:
if name == 'SPACK_TRANSITIVE_INCLUDE_PATH':
@ -95,7 +94,7 @@ def cmdlist(str):
fout.write(
'env[%s] = "%s".join(cmdlist("""\n' % (repr(name), sep))
for part in string.split(val, sep):
for part in val.split(sep):
fout.write(' %s\n' % part)
fout.write('"""))\n')