diff options
Diffstat (limited to 'nshelper.tcl')
-rw-r--r-- | nshelper.tcl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nshelper.tcl b/nshelper.tcl index 33acb51..d0cb35a 100644 --- a/nshelper.tcl +++ b/nshelper.tcl @@ -63,6 +63,9 @@ proc {namespace import} {args} { foreach pattern $args { foreach cmd [info commands [namespace canon $current $pattern]] { + if {[namespace qualifiers $cmd] eq $current} { + return -code error "import pattern \"$pattern\" tries to import from namespace \"$current\" into itself" + } alias ${current}::[namespace tail $cmd] $cmd } } |