diff options
author | Steve Bennett <steveb@workware.net.au> | 2014-01-04 09:48:15 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2014-01-15 07:14:32 +1000 |
commit | c6954336d779c7e56aa38ecd6a50ff076ecfabbb (patch) | |
tree | ebca895fc81523861bcabf4f2f24eb61443d9e80 | |
parent | 73a0367ef52e3c9651b8920d06ebbbe526c96c60 (diff) | |
download | jimtcl-c6954336d779c7e56aa38ecd6a50ff076ecfabbb.zip jimtcl-c6954336d779c7e56aa38ecd6a50ff076ecfabbb.tar.gz jimtcl-c6954336d779c7e56aa38ecd6a50ff076ecfabbb.tar.bz2 |
pid: error message is now tcl 8.6 compatible
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | tclcompat.tcl | 10 | ||||
-rw-r--r-- | tests/pid.test | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tclcompat.tcl b/tclcompat.tcl index fda1234..b2e8139 100644 --- a/tclcompat.tcl +++ b/tclcompat.tcl @@ -193,14 +193,14 @@ proc popen {cmd {mode r}} { } # A wrapper around 'pid' which can return the pids for 'popen' -local proc pid {{chan {}}} { - if {$chan eq ""} { +local proc pid {{channelId {}}} { + if {$channelId eq ""} { tailcall upcall pid } - if {[catch {$chan tell}]} { - return -code error "can not find channel named \"$chan\"" + if {[catch {$channelId tell}]} { + return -code error "can not find channel named \"$channelId\"" } - if {[catch {$chan pid} pids]} { + if {[catch {$channelId pid} pids]} { return "" } return $pids diff --git a/tests/pid.test b/tests/pid.test index 1a978cd..2cc9c32 100644 --- a/tests/pid.test +++ b/tests/pid.test @@ -42,9 +42,9 @@ test pid-1.3 {pid command} socket { close $f set pids } {} -test pid-1.4 {pid command} jim { +test pid-1.4 {pid command} { list [catch {pid a b} msg] $msg -} {1 {wrong # args: should be "pid ?chan?"}} +} {1 {wrong # args: should be "pid ?channelId?"}} test pid-1.5 {pid command} { list [catch {pid gorp} msg] $msg } {1 {can not find channel named "gorp"}} |