diff --git a/lib/spack/spack/util/module_cmd.py b/lib/spack/spack/util/module_cmd.py index 00fc4ddc65..e5dc0f84a6 100644 --- a/lib/spack/spack/util/module_cmd.py +++ b/lib/spack/spack/util/module_cmd.py @@ -133,7 +133,10 @@ def load_module(mod): exec(compile(modulecmd('unload', text[i + 1], output=str, error=str), '', 'exec')) # Load the module now that there are no conflicts - load = modulecmd('load', mod, output=str, error=str) + # Some module systems use stdout and some use stderr + load = modulecmd('load', mod, output=str, error='/dev/null') + if not load: + load = modulecmd('load', mod, error=str) exec(compile(load, '', 'exec'))