Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions reframe/core/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Environment:
to be set when this environment is loaded by the framework.
Users may not create or modify directly environments.
"""
name = fields.StringPatternField('name', '(\w|-)+')
name = fields.StringPatternField('name', r'(\w|-)+')
modules = fields.TypedListField('modules', str)
variables = fields.TypedDictField('variables', str, str)

Expand Down Expand Up @@ -80,12 +80,13 @@ def load(self):
if rt.modules_system.is_module_loaded(m):
self._preloaded.add(m)

self._conflicted += rt.modules_system.load_module(m, force=True)
for conflict in self._conflicted:
stmts = rt.modules_system.emit_unload_commands(conflict)
conflicted = rt.modules_system.load_module(m, force=True)
for c in conflicted:
stmts = rt.modules_system.emit_unload_commands(c)
self._load_stmts += stmts

self._load_stmts += rt.modules_system.emit_load_commands(m)
self._conflicted += conflicted

for k, v in self._variables.items():
if k in os.environ:
Expand Down