summaryrefslogtreecommitdiffstats
path: root/library/tcltest/tcltest.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/tcltest/tcltest.tcl')
-rw-r--r--library/tcltest/tcltest.tcl22
1 files changed, 6 insertions, 16 deletions
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl
index ca503a2..1d3a0b8 100644
--- a/library/tcltest/tcltest.tcl
+++ b/library/tcltest/tcltest.tcl
@@ -16,7 +16,7 @@
# Contributions from Don Porter, NIST, 2002. (not subject to US copyright)
# All rights reserved.
#
-# RCS: @(#) $Id: tcltest.tcl,v 1.83 2003/07/16 14:31:06 dgp Exp $
+# RCS: @(#) $Id: tcltest.tcl,v 1.84 2003/07/18 21:15:13 dgp Exp $
package require Tcl 8.3 ;# uses [glob -directory]
namespace eval tcltest {
@@ -1605,26 +1605,16 @@ proc tcltest::Eval {script {ignoreOutput 1}} {
if {!$ignoreOutput} {
set outData {}
set errData {}
- set callerHasPuts [llength [uplevel 1 {
- ::info commands [::namespace current]::puts
- }]]
- if {$callerHasPuts} {
- uplevel 1 [list ::rename puts [namespace current]::Replace::Puts]
- } else {
- interp alias {} [namespace current]::Replace::Puts {} ::puts
- }
- uplevel 1 [list ::namespace import [namespace origin Replace::puts]]
+ rename ::puts [namespace current]::Replace::Puts
+ namespace eval :: \
+ [list namespace import [namespace origin Replace::puts]]
namespace import Replace::puts
}
set result [uplevel 1 $script]
if {!$ignoreOutput} {
namespace forget puts
- uplevel 1 ::namespace forget puts
- if {$callerHasPuts} {
- uplevel 1 [list ::rename [namespace current]::Replace::Puts puts]
- } else {
- interp alias {} [namespace current]::Replace::Puts {}
- }
+ namespace eval :: namespace forget puts
+ rename [namespace current]::Replace::Puts ::puts
}
return $result
}