diff options
author | sebres <sebres@users.sourceforge.net> | 2020-02-17 14:50:45 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2020-02-17 14:50:45 (GMT) |
commit | 471091f55ae64b4d82644288198e183d8a1865c5 (patch) | |
tree | b2f7e39feb5ef33d34d4e26ef8558b3baced76b4 | |
parent | 5c380477df5c64afa2d44cbf1637c4760cfb0a0b (diff) | |
download | tcl-471091f55ae64b4d82644288198e183d8a1865c5.zip tcl-471091f55ae64b4d82644288198e183d8a1865c5.tar.gz tcl-471091f55ae64b4d82644288198e183d8a1865c5.tar.bz2 |
windows: avoid create of legacy error-vars on init phase (in fresh created interpreter) - no tcl_pkgPath variable on windows
-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 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} { |