Skip to content

Commit f9bba34

Browse files
committed
Remove dependency to try_modulefile of cmdModuleUnload
The try_modulefile state does not impact the cmdModuleUnload procedure as the only kind of error reported here is when an empty module name is specified. Such error should be reported whatever the try_modulefile state.
1 parent 5354116 commit f9bba34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tcl/subcmd.tcl.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,14 +1197,13 @@ proc cmdModuleUnload {context match auto force onlyureq onlyndep args} {
11971197
# unloading module is visible by default
11981198
set hidden 0
11991199
set uasked 1
1200-
# error if module not found or forbidden
1201-
set notfounderr [expr {![currentState try_modulefile]}]
12021200

12031201
# record evaluation attempt on specified module name
12041202
registerModuleEvalAttempt $context $mod
12051203
# resolve by also looking at matching loaded module and update mod
12061204
# specification to fully match obtained loaded module
1207-
lassign [getPathToModule $mod {} $notfounderr $match] modfile modname\
1205+
# enable report_issue flag to report empty module name issue
1206+
lassign [getPathToModule $mod {} 1 $match] modfile modname\
12081207
modnamevr errkind
12091208

12101209
# set a unique id to record messages related to this evaluation.
@@ -1242,7 +1241,8 @@ proc cmdModuleUnload {context match auto force onlyureq onlyndep args} {
12421241
2]"
12431242
}
12441243
} else {
1245-
set ret $notfounderr
1244+
# return error code in case of empty module name
1245+
set ret 1
12461246
}
12471247
# go to next module to unload
12481248
continue

0 commit comments

Comments
 (0)