From c3662492deed98557df9ba1e155124be7f08feb2 Mon Sep 17 00:00:00 2001 From: Tristan Carel Date: Wed, 13 Mar 2019 02:34:47 +0100 Subject: [PATCH] Do not use `string` module to be compatible with python 3 (#248) (#10667) `string.find` is not part of Python 3 anymore. --- lib/spack/spack/cmd/setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/cmd/setup.py b/lib/spack/spack/cmd/setup.py index c4448e1605..aa391b2b35 100644 --- a/lib/spack/spack/cmd/setup.py +++ b/lib/spack/spack/cmd/setup.py @@ -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')