Skip to content

Commit 0119dc0

Browse files
committed
Report nearly-forbidden warning only after module eval
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent 7dc5179 commit 0119dc0

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

tcl/interp.tcl.in

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,6 @@ proc execute-modulefile {modfile modname modnamevrvar modspec requested\
222222
collectModuleTags $modnamevr
223223
}
224224

225-
# inform that access to module will be soon denied
226-
if {$mode ne {unload} && [isModuleTagged $modnamevr nearly-forbidden 1\
227-
$modfile]} {
228-
reportWarning [getNearlyForbiddenMsg $modnamevr $modfile]
229-
set nearlyforbidwarn 1
230-
}
231-
232225
if {![info exists ::g_modfileUntrackVars]} {
233226
# list variable that should not be tracked for saving
234227
array set ::g_modfileUntrackVars [list ModulesCurrentModulefile 1 env 1]
@@ -347,8 +340,7 @@ proc execute-modulefile {modfile modname modnamevrvar modspec requested\
347340
}
348341
}
349342
if {$mode ni {unload refresh scan whatis}} {
350-
if {![info exists nearlyforbidwarn] && [isModuleTagged $modnamevr\
351-
nearly-forbidden 1 $modfile]} {
343+
if {[isModuleTagged $modnamevr nearly-forbidden 1 $modfile]} {
352344
reportWarning [getNearlyForbiddenMsg $modnamevr $modfile]
353345
}
354346
if {[isModuleTagged $modnamevr warning 1 $modfile]} {

0 commit comments

Comments
 (0)