Tk Library Source Code

View Ticket
Login
Ticket UUID: 1774302
Title: error in CommRunHook error handling
Type: Bug Version: None
Submitter: boakley Created on: 2007-08-14 20:12:58
Subsystem: comm Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2007-08-15 03:41:50
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2007-08-14 20:41:50
Description:
In proc ::comm::CommRunHook there is a block of code that looks like this:

    if {<something> {
set code [catch {interp eval $interp $cmd} res]
    } else {
set code [catch {uplevel 1 $cmd} res]
    }

    switch -exact -- $code {
0 {}
1 {
    return -errorinfo $::errorInfo -errorcode $::errorCode -code error $result
}
3 {return}
4 {}
default {return -code $code $res}
    }


Notice that the first few lines set the variable "res" as the result of the catch, but the "1" case in the switch tries to use the variable $result.
User Comments: andreas_kupries added on 2007-08-15 03:41:50:
Logged In: YES 
user_id=75003
Originator: NO

Yep, bug. Fixed in head, comm version now 4.5.5.