File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -497,12 +497,6 @@ proc module {command args} {
497497 # within sourced file evaluation as top load command
498498 if {[isTopEvaluation]} {
499499 set ret [cmdModuleLoad load 1 $tag_list {*}$args ]
500- # raise error if no module has been loaded or has produced an
501- # error during its load attempt
502- if {!$ret && $command eq {load -any} && ![is-loaded {*}$args ]\
503- && ![is-loading {*}$args ]} {
504- knerror " No module has been loaded"
505- }
506500 } elseif {$mode eq {load }} {
507501 # load here if try-load or no auto mode (done through prereq
508502 # elsewhere, inhibited if currently in DepRe context)
Original file line number Diff line number Diff line change @@ -826,13 +826,13 @@ proc cmdModuleLoad {context uasked tag_list args} {
826826 reportDebug " loading $args (context=$context , uasked=$uasked )"
827827
828828 set ret 0
829+ set loadok 0
829830 lappendState mode load
830831 foreach mod $args {
831832 # stop when first module in list is loaded if processing load-any cmd
832- if {[ info exists loadok] && $loadok && [currentState any_modulefile]} {
833+ if {$loadok && [currentState any_modulefile]} {
833834 break
834835 }
835- set loadok 0
836836
837837 # if a switch action is ongoing...
838838 if {$context eq {swload}} {
@@ -1166,6 +1166,13 @@ proc cmdModuleLoad {context uasked tag_list args} {
11661166 }
11671167 lpopState mode
11681168
1169+ # raise error if no module has been loaded or has produced an error during
1170+ # its load attempt in case of load-any sub-command
1171+ if {!$ret && !$loadok && $context eq {load } && [currentState\
1172+ any_modulefile]} {
1173+ knerror " No module has been loaded"
1174+ }
1175+
11691176 return $ret
11701177}
11711178
You can’t perform that action at this time.
0 commit comments