diff options
author | sebres <sebres@users.sourceforge.net> | 2020-02-17 14:52:54 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2020-02-17 14:52:54 (GMT) |
commit | e2bcebca7960c4d0ef4d4763bb4025b6d9bce7bf (patch) | |
tree | c2b9154d1dffb890c75c9a63a787e3e008861768 | |
parent | 958180f361624feca02e571e1de44329d67df0d1 (diff) | |
parent | 471091f55ae64b4d82644288198e183d8a1865c5 (diff) | |
download | tcl-e2bcebca7960c4d0ef4d4763bb4025b6d9bce7bf.zip tcl-e2bcebca7960c4d0ef4d4763bb4025b6d9bce7bf.tar.gz tcl-e2bcebca7960c4d0ef4d4763bb4025b6d9bce7bf.tar.bz2 |
merge 8.5
-rw-r--r-- | library/init.tcl | 4 | ||||
-rw-r--r-- | tests/init.test | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/library/init.tcl b/library/init.tcl index 5cda0d9..5cc0fee 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 639389f..1d838ef 100644 --- a/tests/init.test +++ b/tests/init.test @@ -18,6 +18,19 @@ if {"::tcltest" ni [namespace children]} { # 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} { |