From: <kak...@us...> - 2008-05-31 19:28:10
|
Revision: 10070 http://amsn.svn.sourceforge.net/amsn/?rev=10070&view=rev Author: kakaroto Date: 2008-05-31 12:28:03 -0700 (Sat, 31 May 2008) Log Message: ----------- Should be a better way to check if a handler is a snit object or not Modified Paths: -------------- trunk/amsn/bugs.tcl trunk/amsn/protocol.tcl Modified: trunk/amsn/bugs.tcl =================================================================== --- trunk/amsn/bugs.tcl 2008-05-31 18:59:36 UTC (rev 10069) +++ trunk/amsn/bugs.tcl 2008-05-31 19:28:03 UTC (rev 10070) @@ -2,7 +2,12 @@ ::Version::setSubversionId {$Id$} proc bgerror { args } { - ::bugs::bgerror $args + set err $::errorInfo + if { [catch {::bugs::bgerror $args} res ] } { + puts $err + puts $::errorInfo + error $res + } } namespace eval ::bugs { Modified: trunk/amsn/protocol.tcl =================================================================== --- trunk/amsn/protocol.tcl 2008-05-31 18:59:36 UTC (rev 10069) +++ trunk/amsn/protocol.tcl 2008-05-31 19:28:03 UTC (rev 10070) @@ -3898,22 +3898,28 @@ set handler_args [lrange $cmd 1 end] set handler_numargs [llength $handler_args] set handler_realargs [list] - #snit with tcl 8.5 throws an error - if {[catch {set handler_realargs [info args $handler]}]} { - set method [lindex $cmd 1] - set handler_args [lrange $cmd 2 end] - set handler_numargs [llength $handler_args] - set handler_realargs [$handler info args $method] - status_log "Detected snit object $handler. Method was $method" blue + + set handler_is_snit 0 + #snit with tcl 8.5 creates a command, but not a proc + if {[info command $handler] == "$handler" && + [info proc $handler] == "" } { + set handler_is_snit 1 + } else { + set handler_realargs [info args $handler] + #snit with tcl 8.4 gives us "method args" + if {$handler_realargs == "method args" } { + set handler_is_snit 1 + } } - #snit with tcl 8.4 gives us "method args" - if {$handler_realargs == "method args" } { + + if {$handler_is_snit } { set method [lindex $cmd 1] set handler_args [lrange $cmd 2 end] set handler_numargs [llength $handler_args] set handler_realargs [$handler info args $method] status_log "Detected snit object $handler. Method was $method" blue } + set handler_num_realargs [llength $handler_realargs] if {$handler_num_realargs == [expr {$handler_numargs + 1}] } { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |