Adding needed import modules. Changed platform_name to platform to prevent syntax errors
This commit is contained in:
parent
9615efd940
commit
aab1a67d05
@ -91,6 +91,7 @@
|
||||
expansion when it is the first character in an id typed on the command line.
|
||||
"""
|
||||
import sys
|
||||
import imp
|
||||
import itertools
|
||||
import hashlib
|
||||
import base64
|
||||
@ -100,6 +101,7 @@
|
||||
from external.yaml.error import MarkedYAMLError
|
||||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import join_path
|
||||
from llnl.util.lang import *
|
||||
from llnl.util.tty.color import *
|
||||
|
||||
@ -109,6 +111,7 @@
|
||||
import spack.compilers as compilers
|
||||
|
||||
from spack.version import *
|
||||
from spack.util.naming import mod_to_class
|
||||
from spack.util.string import *
|
||||
from spack.util.prefix import Prefix
|
||||
from spack.virtual import ProviderIndex
|
||||
@ -1246,9 +1249,9 @@ def add_target_from_string(self, target):
|
||||
|
||||
if platform != '':
|
||||
# Find the class for the platform name given
|
||||
file_path = join_path(spack.platform_path, platform_name)
|
||||
file_path = join_path(spack.platform_path, platform)
|
||||
platform_mod = imp.load_source('spack.platforms', file_path + '.py')
|
||||
cls = getattr(platform_mod, mod_to_class(platform_name))
|
||||
cls = getattr(platform_mod, mod_to_class(platform))
|
||||
platform = cls()
|
||||
else:
|
||||
platform = spack.architecture.sys_type()
|
||||
|
Loading…
Reference in New Issue
Block a user