summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/init.tcl4
-rw-r--r--tests/init.test13
2 files changed, 15 insertions, 2 deletions
diff --git a/library/init.tcl b/library/init.tcl
index eb6b04e..0a5e71b 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -57,13 +57,13 @@ namespace eval tcl {
if {$Dir ni $::auto_path} {
lappend ::auto_path $Dir
}
- catch {
+ if {[info exists ::tcl_pkgPath]} { catch {
foreach Dir $::tcl_pkgPath {
if {$Dir ni $::auto_path} {
lappend ::auto_path $Dir
}
}
- }
+ }}
if {![interp issafe]} {
variable Path [encoding dirs]
diff --git a/tests/init.test b/tests/init.test
index 07270e1..d56c72d 100644
--- a/tests/init.test
+++ b/tests/init.test
@@ -18,6 +18,19 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
# Clear out any namespaces called test_ns_*
catch {namespace delete {*}[namespace children :: test_ns_*]}
+test init-0.1 {no error on initialization phase (init.tcl)} -setup {
+ interp create slave
+} -body {
+ slave eval {
+ list [set v [info exists ::errorInfo]] \
+ [if {$v} {set ::errorInfo}] \
+ [set v [info exists ::errorCode]] \
+ [if {$v} {set ::errorCode}]
+ }
+} -cleanup {
+ interp delete slave
+} -result {0 {} 0 {}}
+
# Six cases - white box testing
test init-1.1 {auto_qualify - absolute cmd - namespace} {