Repository: spack/spack

Issue:
spack install boost fails on python3
```
==> Error: AttributeError: 'dict' object has no attribute 'iteritems'
/home/junghans/spack/var/spack/repos/builtin/packages/boost/package.py:167, in determine_toolset:
     155      def determine_toolset(self, spec):
     156          if spec.satisfies("platform=darwin"):
     157              return 'darwin'
     158
     159          toolsets = {'g++': 'gcc',
     160                      'icpc': 'intel',
     161                      'clang++': 'clang',
     162                      'xlc++': 'xlcpp',
     163                      'xlc++_r': 'xlcpp'}
     164
     165          if spec.satisfies('@1.47:'):
     166              toolsets['icpc'] += '-linux'
  >> 167          for cc, toolset in toolsets.iteritems():
     168              if cc in self.compiler.cxx_names:
     169                  return toolset
     170
     171          # fallback to gcc if no toolset found
     172          return 'gcc'
```
I guess we should do a `git grep iteritems`.


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -164,7 +164,7 @@ def determine_toolset(self, spec):
 
         if spec.satisfies('@1.47:'):
             toolsets['icpc'] += '-linux'
-        for cc, toolset in toolsets.iteritems():
+        for cc, toolset in toolsets.items():
             if cc in self.compiler.cxx_names:
                 return toolset
 
diff --git a/var/spack/repos/builtin/packages/openfoam-com/package.py b/var/spack/repos/builtin/packages/openfoam-com/package.py
--- a/var/spack/repos/builtin/packages/openfoam-com/package.py
+++ b/var/spack/repos/builtin/packages/openfoam-com/package.py
@@ -140,7 +140,7 @@ def rewrite_environ_files(environ, **kwargs):
     """
     posix = kwargs.get('posix', None)
     if posix and isfile(posix):
-        for k, v in environ.iteritems():
+        for k, v in environ.items():
             filter_file(
                 r'^(\s*export\s+%s)=.*$' % k,
                 r'\1=%s' % v,
@@ -148,7 +148,7 @@ def rewrite_environ_files(environ, **kwargs):
                 backup=False)
     cshell = kwargs.get('cshell', None)
     if cshell and isfile(cshell):
-        for k, v in environ.iteritems():
+        for k, v in environ.items():
             filter_file(
                 r'^(\s*setenv\s+%s)\s+.*$' % k,
                 r'\1 %s' % v,
@@ -616,7 +616,7 @@ def configure(self, spec, prefix):
                 cshell=join_path('etc', 'prefs.csh'))
 
         # Adjust components to use SPACK variants
-        for component, subdict in self.etc_config.iteritems():
+        for component, subdict in self.etc_config.items():
             write_environ(
                 subdict,
                 posix=join_path('etc', 'config.sh',  component),
diff --git a/var/spack/repos/builtin/packages/openfoam-org/package.py b/var/spack/repos/builtin/packages/openfoam-org/package.py
--- a/var/spack/repos/builtin/packages/openfoam-org/package.py
+++ b/var/spack/repos/builtin/packages/openfoam-org/package.py
@@ -386,7 +386,7 @@ def configure(self, spec, prefix):
                 cshell=join_path('etc', 'prefs.csh'))
 
         # Adjust components to use SPACK variants
-        for component, subdict in self.etc_config.iteritems():
+        for component, subdict in self.etc_config.items():
             write_environ(
                 subdict,
                 posix=join_path('etc', 'config.sh',  component),


Test patch: